Game Development Community

Relative camera transform problems

by Valador, Inc. · in Torque Game Engine · 06/19/2007 (6:50 pm) · 4 replies

I've modified the camera class to support relative transformation (without use of mount points), but I've ran into some problems:

The overall idea: I can pick any shapebase-derived object to be the "origin of the universe" for any particular Camera instance. All camera movement (translation and rotation) is then relative to this ShapeBase derived object.

So far, so good, except for one big thing:

Whenever the final 4x4 matrix specifies a rotation around the lookat vector of the camera (a roll), it has no noticeable effect on the view: the camera's z vector (up vector) seems to be parallel to the global z vector at all times.

Pitch and yaw don't seem to give me any problems. The roll doesn't roll my viewpoint camera at all; it just seems to rotate the plane along which my flymode camera travels.

How can I rotate the camera (without using mount points) so that the up vector of the camera (z vector) is not parallel with the global z vector (global up vector)? In other words, HOW CAN I GET THE CAMERA TO VIEW THE WORLD ON ITS SIDE??

Any suggestings, explanations, hints, etc., are deeply appreciated.

Thanks,

Frank

#1
06/21/2007 (1:55 am)
......
#2
06/21/2007 (2:00 am)
I hate to be picky, but posting of source code isn't allowed in public forums. If both of you guys don't mind, please move this conversation (and delete the source code) to one of the TGE private forums.
#3
06/21/2007 (2:15 am)
Hey Stephen,

Sorry about that, you are right. I didn't realize this was in a public forum, I should have paid more attention. I was just coming back now because I thought it might have been and it was.

Frank, please re-post your question in a private forum and I'll answer it there.