Announcement

Collapse
No announcement yet.

origPoint coordinate space?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • origPoint coordinate space?

    Hello,

    I'm trying to write a V-Ray shader that uses texture bombing. I'm using rc.rayresult.origPoint to get the position of my point (P) and then testing that to see whether it's within my 'bomb' radius. This works fine, however I'm finding that P seems to vary dependent on the camera position and so my bombs will move around as the camera moves, which I don't want. So I'm not sure if I'm implementing this correctly... should I be using a different value (I've tried origPoint and wpoint)? What co-ordinate space is the origPoint value specified in? Or is there a way to change the coordinate space so that I can keep it consistent?

    Any help would be greatly appreciated!

    Thanks very much,

    Lindsey

  • #2
    You need to add rc.vray->getFrameData().sceneOffset to rc.rayresult.origPoint (or subtract it, I never remember which one) to get the coordinates in world space.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Fab! Adding the sceneOffset fixed it.

      Thanks very much for the help!

      Comment

      Working...
      X