Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ARID

Simulation HELP

This topic is 6378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am building a driveing simulation for my US first team (We build robots) I am building this sim to help train the drivers. Well heres the prolbem. I am trying to make a setting where the driver is in the control terminal. So his view can do one of two things eather not move at all or fallow the movement of the robot. I would prefer to have the view track the robot (like a person watching it as it moves around not track as in a flying camera overhead). This poses a problem (I am useing this as an introduction to future programing indevors so I can get used to gameish programing) I want the user to control the robot useing a mouse or joystick (simple Direct Input which I don't realy need help with) the robot starts faceing the same direction as you then can move in any direction forward of backward and turn so my problem is how would I go about allowing the robot to move in all thease directions without moveing the camera (i am vermiliar with Vectors, cross products, and dot products so the math won't confuse me if you tell me what it does I can figure out what does what) If i moved the camera it would be easier I would just translate and rotate the whole world. So give me a little help here. ()xxx)(:::::::::::> It's not Cheating, It's useing your opertunitys to your advantage <::::::::::(xxx() Edited by - ARID on January 27, 2001 8:44:24 PM

Share this post


Link to post
Share on other sites
Advertisement
Just bringing the post to the top I REALY need help with this one. I was thinking of useing the glLookAt but i''m not shure that would work.

A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.

Share this post


Link to post
Share on other sites
I don''t understand the difference between a camera tracking it from overhead and a person following it. Is the main difference that the person''s view would be at an angle while the camera would have an exact bird''s eye view?

If so, then gluLookAt would probably the easiest thing to use. Say you wanted the camera to be 5 units below the robot on the y axis and 5 above the floor on the z axis. You could track the robot with the following line: gluLookAt(robot.x, robot.y - 5, 5, robot.x, robot.y, robot.z, 0, 1, 0);

the first three parameters specify the location of the camera, the second three a point that the camera is ''looking at,'' and the last three an ''up vector.'' The up vector essentially dictates what direction should be ''up'' when drawn to the screen; in this case the up vector will make the positive y axis go up. I _think_ that this vector should be orthogonal to the vector from the position to the ''look at'' point but it seems to work fine even when it''s not.

Share this post


Link to post
Share on other sites
I musn''t have been vey clear i''m sory about that. What I need to do is not have the player move at all he cant move he''s stuck in the players station on the playing surface this means he can only look at the robot not move from the starting point. so how would I control the robot so It moves I am very stumped.

A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.

Share this post


Link to post
Share on other sites
I don''t know but not the camera just sits in one place and looks at the robot like a spectator.

Share this post


Link to post
Share on other sites
I know that. I mean in the gameworld the camera "never moves" think of the player as a spectator he stands in one spot and moves the robot.

Share this post


Link to post
Share on other sites
I don''t know anything about OpenGL, but don''t you have an Object-World transformation matrix which converts your object''s local coordinate system (centered around the origin of the object) to the world coordinate system. Just alter this matrix, translation to move the object and rotation to rotate it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!