Jump to content
  • Advertisement

Archived

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

baldurk

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.

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

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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 this post


Link to post
Share on other sites
Guest Anonymous Poster
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 this post


Link to post
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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!