Skip to main content
gamedev.net
🔒 Locked

3d game engine

Started by jonrodgerwood Nov 24, 2001 at 11:53 AM 3 replies 150+ views
Original Post
jonrodgerwood
jonrodgerwood
Does anyone know of a good tutorial for moving around in 3 dimensions in 3d object space? I''m programming a 1st person 3d game. My keys are mapped as follow left arrow-rotate left, right arow-rotate right, and the down and up arrows rotate the camera down and up. However, my math and/or code is screwed up. If I rotate to the right 180 degrees and then try to rotate up, the camera actually rotates down. Perhaps I need to check the signs on my trig functions. If anyone can post a link I would be very grateful since I''m a beginner. I checked out Nehe''s tutorials but they didn''t deal with rotating the camera up and down. thanks!
v71
v71
Its not that simple like checking the sign of angles you are talking about a viewing direction using some kind of ''aiming'' and moving towards that direction, there is a lot of math involved and too few space to put the math here, just to give you an hint try to look at quaternions or euler parameters or angles , there is though an issue related to the last topic, the gimbal lock, anyway study quaternions and you''ll get all the answers you need. byez
P.S. sorry for my english.


hlusnagen
hlusnagen
Are you rotatic you lookat vector too?
lookat.x = sin(ang);
lookat.z = cos(ang);
lookat.y = eye.y;

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.