steering objects

Started by
20 comments, last by baldurk 23 years, 5 months ago
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.
Advertisement
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.
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 --//
Help.

I am only 13 years old and I haven`t the foggiest as to what normals are
learn it now it''ll help you in your trigonometry
seriously
Learn it, the most complicated thing in maths I have done in maths so far is algebra! I don`t 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?
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!
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?
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.
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

This topic is closed to new replies.

Advertisement