Notifications
Clear all

[Closed] SDK Set Node Direction

Hi, I’m looking for a C++ version for the Node.dir in maxscript. I’ve looked in the samples and just can’t find anything. Any help ??

4 Replies

Is it not the same than the third component of the transform matrix? ($.transform.row3)

Unfortunately not, as the node.dir seems to effect all the first 3 rows off the matrix. I just can’t figure out what its doing though As there doesn’t seem to be anything in the SDK that can set node.dir

here is equivalent of applying a dir:

fn setNodeDir node dir = 
(
	dtm = arbaxis (normalize dir)
	itm = node.transform
	ftm = translate (rotate (scalematrix itm.scale) dtm.rotation) itm.pos
	node.transform = ftm
) 
node.dir = dir 
-- is the same as
setNodeDir node dir

i hope that will not be a problem to convert it to c++

Thanks Denis, it worked perfectly !!!