Simulation HELP

Started by
11 comments, last by ARID 23 years, 2 months ago
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
A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.
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.
A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.
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.
--Riley
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.
A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.
Does the camera ever move at all? Does it just rotate to look at the robot?

I think you need to push and pop matrices.
I don''t know but not the camera just sits in one place and looks at the robot like a spectator.
A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.
Camera NEVER moves in GL, you rotate the world
(you can find me on IRC : #opengl on undernet)
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.
A man walks into a bar.....ouch!?! Ya get it, do ya huh huh well....awww I give up.
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.
Gee Brain, what we gonna do tonight?
y not try my OGL camera class.

This topic is closed to new replies.

Advertisement