Quantcast
Channel: Latest Questions by Eux86
Viewing all articles
Browse latest Browse all 26

Vector3 constructor precision

$
0
0

I'm having a problem creating a Vector3 variable, starting with 2 other float variables. This is a snipped of code:

float indz = Mathf.Cos(alpha);
float indx = Mathf.Sin(alpha);
Vector3 ind = new Vector3(indx,0,indz);

the variables' value are:

indz = 0.999954
indx = 0.009595863

the resulting vector is:

ind = (0.0, 0.0, 1.0)

Why this? And how can I avoid this issue? I need that vector because I have to transform it in the coordinate system of another object, and I need it at the maximum precision. Thanks!


Viewing all articles
Browse latest Browse all 26

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>