i couldnt figure this one out for ages. I am doing pythag on a normal vector with values:
x: 0.952419936657
y: 0.304788768291
z: 9.01522412278e-07
i didnt realise but it seems maya couldnt process the 'e-07' part of the z direction. so if you square it z*z you get 81.274265984 rather than the tiny number it should be
does anyone know how make python deal with a number like 9.01522412278e-07 ? so its in decimal form?
any help would be awesome,
thanks,
Sam
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d96dc0d3-4673-45d4-977f-c1ebbc4beb41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
so ive got
x= 0.952419936657
y= 0.304788768291
z= 9.01522412278e-07
so i do pythag
pythag=math.sqrt((x*x)+(y*y)+(z*z))
pythag=0.999999964509
x=0.952419936657/pythag
y=0.304788768291/pythag
z=9.01522412278e-07/pythag
so after this, all values need to be less than 1 right?
but z is like this: 9.01522444274e-07 .which i cant use as unit vector. i think it needs converting to decimal or something?
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/73567498-a0d2-49e3-90b0-ddd5a94bc1bb%40googlegroups.com.
its working now. i just realised it was because i was checking if the value was usable by pasting the z result into the direction z field in maya, and it couldnt read the value with e-07 at the end. i fed it in as a variable name in my script and it works now.
thanks for your help,
Sam;)