Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1039

Daz script sin() and cos() functions

$
0
0

I've started playing with scripts. What I want to do is rotate an object - that bit I've got working (i.e. writing different Xrot values to successive frames). But it rotates about the bottom of the object, rather than its centre - so I've got to apply deltas to the Y and Z transforms to correct the apparant centre of rotation - and for that I need to use sin() and cos(). Except I get a runtime error "ReferenceError: Can't find variable: sin". So I assume I haven't understood the syntax correctly. I have the angle in radians in a DzVec3 variable (x, y, z) called ang (ang.x is limited to +/- PI), and the line which throws the error is as follows:

var deltaY = -(217 * sin(ang.x));

(217 being the distance from the base of the object being rotated to my required centre of rotation).

 


Viewing all articles
Browse latest Browse all 1039

Trending Articles



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