CameraToViewportRay

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
madtulip
Halfling
Posts: 78
Joined: Thu Nov 18, 2004 6:35 pm
Contact:

CameraToViewportRay

Post by madtulip » Sat Mar 26, 2005 2:28 pm

Code: Select all

Ray mouseRay = mCamera->getCameraToViewportRay( e->getX(), e->getY() );
seem to be performed internaly by the cameras position and orientaion, rather then its derivered position and rerivered orientaion. why could that be usefull ?

in my application i got a 3rd person camera behind a ship. the node are set up like

controlnode
shipnode (child of controlnode)
cameranode (child of controlnode)

if i start a CameraToViewportRay the rays works with the position and orientation of the camera relative to the controlnode. atm i cant see why that should be usefull, as the picture the camera is producing is also been taken from the derivered position and derivered orientation.as the name "camera to viewport ray" indicates i want to shoot the ray to the viewport, the not derivered orientation and position is not in all cases the viewport (the things i can see, as far as i understand that word) i can see.

maybe i made a mistake in my code, but this behavior was quite irritating to me first. im now using to get the derivered position and orientation of my cameranode (child of controlnode) and place a newcameranode (child of root node) at that settings from wich it seems to work well.
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 2
Contact:

Post by sinbad » Sat Mar 26, 2005 5:52 pm

I think you must be using an old version. Camera does use the derived position and derived orientation to determine the viewport ray.
0 x

madtulip
Halfling
Posts: 78
Joined: Thu Nov 18, 2004 6:35 pm
Contact:

Post by madtulip » Sun Mar 27, 2005 10:42 pm

im using the sdk and you where right. the position is derivered. the problem was and is at the other end of the ray, the mousecursor. the x and y coordinates where bugged due to a failur i made in the code.im sorry.
0 x

Post Reply