steering objects
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.
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.
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 --//
-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
I am only 13 years old and I haven`t the foggiest as to what normals are
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?
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!
Do a search here at the GDnet forums for "normals", they''re easy!
October 29, 2000 11:03 AM
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?
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?
October 29, 2000 12:03 PM
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement