Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Rotating a 3D object and Camera controls

Author
Message
will3330
15
Years of Service
User Offline
Joined: 24th Mar 2009
Location:
Posted: 24th Mar 2009 16:03
I have a 3D object in a space that moves forward, back, left and right based on the front position of the camera. I want to rotate the character around along with the camera. If I use the dbMoveObject(Direction), is it based on the position of the camera (like if I rotate the camera 90 degrees, will the object move forward based on the new direction of the camera?)?
Nomnom
15
Years of Service
User Offline
Joined: 17th Mar 2009
Location:
Posted: 25th Mar 2009 05:30
I think you mean "dbMoveObject(Speed)", not Direction. And that will move the object in the direction it's pointing, not the direction the camera is pointing.

Generally things are done like this: The character moves around and the camera is then placed behind it. What you seem to want to do is the opposite.

In this case, you'd probably do something along the lines of:
dbPositionObject( obj, dbCameraPositionX(), dbCameraPositionY(), dbCameraPositionZ() );
dbRotateObject( obj, dbCameraAngleX(), dbCameraAngleY(), dbCameraAngleZ() );
dbMoveObject( obj, distance_from_camera );

<><

Login to post a reply

Server time is: 2024-09-30 21:17:44
Your offset time is: 2024-09-30 21:17:44