puzzled in the coordinate frame of OGRE!

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
undersea
Gnoblar
Posts: 8
Joined: Tue May 17, 2005 9:47 am

puzzled in the coordinate frame of OGRE!

Post by undersea »

The world coordinate frame is right-handed. Then what about the camera coordinate frame, right-handed or left-handed?

I am seting the position and orientation of camera according to the real camera, so I must know the definition of the camera coordinate frame.
Help!!!
User avatar
SuprChikn
Bugbear
Posts: 863
Joined: Tue Apr 19, 2005 6:10 am
Location: Melbourne, Aus
Contact:

Post by SuprChikn »

What do you mean by "the real camera"?
In Ogre, X is left-right, Y is up-down, Z is forward-backward.
What more do you need to know? Rotations? About the X is pitch, about the Y is yaw, and about the Z is roll.
undersea
Gnoblar
Posts: 8
Joined: Tue May 17, 2005 9:47 am

Post by undersea »

I am designing AR(augmented system) and choose OGRE as rendering engine. I can get the position and orientationof real camera relative to markers in real world. Now, I want to set the position and orientation of camera in OGRE according to real camera. So I have to know the definition of camera in OGRE.
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

Define "definition". No clue what you want to know beside what SuperChikn already said. Camera looks towards its local -Z. Up is +Y and right is +X. Is this what you want to know if not: explain.
team-pantheon programmer
creators of Rastullahs Lockenpracht
undersea
Gnoblar
Posts: 8
Joined: Tue May 17, 2005 9:47 am

Post by undersea »

that is to say,in OGRE , world coordinate frame is right-handed?
and camera coordinate frame is also right-handed?
undersea
Gnoblar
Posts: 8
Joined: Tue May 17, 2005 9:47 am

Post by undersea »

as I know, in OpenGL , world coordinate frame is right-handed,
and camera coordinate frame is left-handed.
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

No. Camera is just like I outlined in my last post. This is the same as the OpenGL camera. Don't know where you got the left-handed info from, but it is wrong. Maybe you confused it with the canonical view volume? Because for it the z-axis is flipped.
team-pantheon programmer
creators of Rastullahs Lockenpracht
undersea
Gnoblar
Posts: 8
Joined: Tue May 17, 2005 9:47 am

Post by undersea »

SuprChikn wrote:What do you mean by "the real camera"?
In Ogre, X is left-right, Y is up-down, Z is forward-backward.
What more do you need to know? Rotations? About the X is pitch, about the Y is yaw, and about the Z is roll.
SuprChikn said: X is left-right, Y is up-down, Z is forward-backward,that is, right is +x, down is +y, backward is +z ?? Why down is +y?

the camera coordinate frame, in my opinoin, is the watcher's local coordinate, the z of which should be forward-backward. And the z of world coordinate frame is backward-forward.
User avatar
SuprChikn
Bugbear
Posts: 863
Joined: Tue Apr 19, 2005 6:10 am
Location: Melbourne, Aus
Contact:

Post by SuprChikn »

Sorry, +Y is up, +X is right, and i think-Z is forwards (I could be wrong about the Z).
I was just saying the things I would in normal speach, not in terms of which is + and which is - (ie: you usualy say up/down, rather than down/up, left/right instead of right/left, etc).
undersea
Gnoblar
Posts: 8
Joined: Tue May 17, 2005 9:47 am

Post by undersea »

as you say, camera coordinate frame is left-handed
world coordinate frame is right-handed
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

haffax wrote:Camera looks towards its local -Z. Up is +Y and right is +X. Is this what you want to know if not: explain.
What is so difficult here? Camera is right-handed. Like world is right-handed like both are right-handed in OpenGL. No left-handedness anywhere.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

Confusion is total! :? Like it has been said numerous times in this thread, Ogre uses a right-handed coordinate system. I.e. +X is right, +Y is up, +Z is backwards (out of the screen towards you). If all you want to do is position and orient the camera inside Ogre the same way as a physical camera, you just have to make sure that you convert the coordinates you have for the real camera correctly.
undersea
Gnoblar
Posts: 8
Joined: Tue May 17, 2005 9:47 am

Post by undersea »

thanks a lot for all your help.

then, OGRE and OpenGL are all right-handed. I got it !!
Post Reply