in this case am I right in thinking that unitdir1 will be which way the unit is facing? In which case where's that measured from (IE is that from "north" "south" "east" or "west"). Also am I right in thinking this is returning (stupidly) values from -pi to pi? (Instead of 0 to 2pi which is what I expected... I take it theres a reason...)
I would say unitdir1, unitdir2, unitdir3 are the cartesian coordinates (that, is, the X, the Y, the Z) of a vertex. This vertex direction is the same as the unit direction.
So no, they are not angles in the [-pi,pi] range. They are coordinates in the [-1,1] range (assuming the vertex is normalised).
I would say unitdir1, unitdir2, unitdir3 are the cartesian coordinates (that, is, the X, the Y, the Z) of a vertex. This vertex direction is the same as the unit direction.
So no, they are not angles in the [-pi,pi] range. They are coordinates in the [-1,1] range (assuming the vertex is normalised).
Joined: 12 Jan 2005, 10:25 Location: Still signing off after all these years
Ok, you've both really lost me there? Are you saying that they are the coordinates of a point which a line from the unit center would travel though that is pointing in the direction the unit is facing?
IE, if unitdir1=1 and the others are all 0 the unit is facing towards X?
And if unitdir1=0.5 then either unitdir2 or 3 would be 0.866...ish?
If so thats fine I can work with that, it's just a pain in the arse and I can't imagin why anyone would need those values in that format...
(I assume there is some cool math that you can do with it though and someone who's good at math will prob look at my script and go why the hell is he doing everything like this?)
Joined: 12 Jan 2005, 10:25 Location: Still signing off after all these years
Woohahahha it works. After a lot of head banging I have 3 legs positioned with the power of math! It's strange how you forget how trig works when you havn't done it for 10 years...
not that this pic explains much but the legs are positioned by the numbers echoing at the top, which are worked out from 3 empty peices in the root of the object and then ofset by the unit rotation. (by default all the legs are just pointing stright back...)
This means I can now feed in cordinates of where the leg was previously and move it to there, and thus create the illusion of the feet sticking to the ground... well after I get the legs to also extend out to the points aswell... more math...
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum