Hi,
For the application I am developing I want to be able to move the camera to a specific point and orientation at a certain time (think similar to a cut-scene). I can find the locations and vectors by using blender2crystal but I don't understand how to actually cause the rotation to take place.
At the moment I can load and move the camera around but my attempts to change orientation are ignored (more likely I have forgotten some code). Here is the code I am currently using:
csRef<iCamera> camera = view->GetCamera();
csVector3 camera_pos (0,0.367063,6.75359);
csRef<iCameraPositionList> camposlist = engine->GetCameraPositions ();
csRef<iCameraPosition> campos = camposlist->FindByName("MainCam");
campos->SetForwardVector(csVector3(-2.3441e-007,-0.445272,0.895396));
campos->SetUpwardVector(csVector3(-1.17205e-007,0.895396,0.445271));
campos->SetPosition(camera_pos);
campos->Load(camera,engine);
What happens is when this is triggered the camera moves to the position set but maintains the orientation it was on before it was moved, instead of moving back to point in the direction entered in code.
I also tried using the lookat() function like this:
csOrthoTransform ot = camera->GetTransform();
ot.LookAt (csVector3(-2.3441e-007,-0.445272,0.895396), csVector3(-1.17205e-007,0.895396,0.445271));
ot.GetFront ().Set(csVector3(-2.3441,-0.445272,0.895396));
ot.GetUp ().Set (csVector3(-1.17205,0.895396,0.445271));
camera->SetTransform(ot);
but this has exactly the same effect, no rotation.
If it helps I am using CS 1.2 on Visual Studio 2008, running Windows Vista (not SP1), the version of winlibs that goes with 1.2 and a ATI x1600 video card.
Thanks in advance.