#### Archived

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

# steering objects

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

## Recommended Posts

I have made a object out of quads and I have made it spin like nehes tutorial 7. What I want to know is how to create a variable (e.g. direction) to record which way it is facing and move it apporpriately, as if you can drive it around. Do you see what I mean.

##### Share on other sites
Use the normal of the face you want to be forward... Find the unit vector in that direction and move it along that in increments of one (because it''s a unit vector)... That should do it.

S.

##### Share on other sites
If it''s driving you want, check out my very simple and easy to follow driving thing in the Projects section of the CornflakeZone.com

-fs

http://www.CornflakeZone.com
//-- Modelling and animation in every dimension --//

##### Share on other sites
Help.

I am only 13 years old and I havent the foggiest as to what normals are

seriously

##### Share on other sites
Learn it, the most complicated thing in maths I have done in maths so far is algebra! I dont even know what sine is! and you are suggesting I learn NORMALS? what are you _on_?

sorry about that, but seriously, laerning normals isn`t really an option.

any other help?

##### Share on other sites
I''m very sorry, but you''ll need to learn what normals are because they''re used very much in 3D.

Do a search here at the GDnet forums for "normals", they''re easy!

##### Share on other sites
im 14 and im writing a 3d internet game with directx
i understand sine cosines tangents trignometry etc. etc. etc.
but i just dont get these "normal" thingys
ive heard that they are useful in hidden-surface-removal, but how?

##### Share on other sites
The tutorials tell you what normals are. If I remember correctly, they specify which direction the polygon''s facing so that light can reflect off it accordingly.
Also age is no excuse for anything. You just have to put more effort into it, you don''t have to wait for school to teach you, just figure it out. I would brag about how early I learned how to program but it doesn''t matter.
I made a tank game a really long time ago and this was the code for moving an object in the direction it''s facing. I kept track of it''s angle which would be a good idea if you want to do anything. xPos is the position on the x axis, zPos is the position on the z axis, Angle is the angle of the object in degrees, because im not used to radians. There are 360° in the system I like and 6.28 ° in radians. For some reason sin and cos always use radians so I had to convert them. The *speed at the end is to control how fast it moves, the higher the speed the faster it moves.
zPos -= (1 * cos(Angle/360*6.28))*speed;
xPos -= (1 * sin(Angle/360*6.28))*speed;

I''m not sure if this is what you want, but I hope it helps.

##### Share on other sites
Wait why am I registered as anonymous poster? I wrote that post above and can't edit it to make it not anonymous. Oh well

Edited by - David20321 on October 29, 2000 1:05:52 PM

1. 1
2. 2
3. 3
Rutin
19
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631424
• Total Posts
3000008
×