raycast help

Discussions about SOFTIMAGEs© Interactive Creative Environment©
dafluke
Posts: 4
Joined: 21 Oct 2010, 04:21

raycast help

Post by dafluke » 21 Oct 2010, 04:28

i'm trying to use a 'raycast' node to constrain an object to another object's surface. however i have no idea how to get a direction value from the global rotation value of my raycasting null. i tried reading isner's quaternion tutorial to better understand rotation math.. but i'm just really confused at this point. can anyone help me out with this? thanks!

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 19:11
Location: Zagreb, Croatia

Re: raycast help

Post by Mathaeus » 21 Oct 2010, 07:56

Hi

If i understood this correctly, you'll need to define a local direction first, let's say to type 0, 1, 0 in 3d vector node, then just rotate this vector by global rotation of null - or, mentioned 3d vector node > multiply vector by matrix (matrix is global transform of null) > subtract from global position of null.

dafluke
Posts: 4
Joined: 21 Oct 2010, 04:21

Re: raycast help

Post by dafluke » 21 Oct 2010, 09:34

:) Thanks, the second one did the trick!!