Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
9223372036854775808 is the number returned; from my vector to direction code
Topic Started: Nov 17 2007, 12:56 AM (236 Views)
Eansis
Member Avatar
ghost
[ *  *  *  *  *  * ]
rotx=90+(-arcsin(normalz))/(pi/180)

roty=(arccos((normaly)/cos(-arcsin(normalz)))*(1-2*(normalx<0)))/(pi/180)

Dr. Best gave me this code to calculate the direction from normals. A small percentile of the polygons it works, but for most of them roty returns 9223372036854775808. The number is so high it is too imprecise to be used as a rotation for the game. How do I fix this? Why does this code return such a high value? Is there a better vector to direction code that I can use?

EDIT: I used point_direction(0,0,normalx,normaly) and it works fine. I thought I needed the other code because of the vector layer problem. See other post: http://forum.ultimate3d.org/index.php?showtopic=1356
VOTE FOR BUDDY ROEMER HE'S A STRAIGHTFORWARD, DOWN TO EARTH AMERICAN GUY WHO ISN'T PART OF THE BIGBROTHER CONSPIRACY

Til'c
 
Things will not calm down Daniel Jackson. They will infact calm up.
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply