View Single Post
  #1  
Old 03-09-2012, 08:31 AM
nabrahamson nabrahamson is offline
Member
 
Join Date: Sep 2011
Posts: 36
Get Objects Angle Relative to the screen/viewpoint

I am working on a problem where we have a mouse pointer in our scene that I have either oriented so that it is positioned to the normal vector of a surface, or that it points at the center of the bounding box for an object.

The pointer is modeled to look like a teardrop where the point of the teardrop is "touching" the surface of the object it is pointing at. Due to the rotation of the pointer, there are cases were the point of the teardrop are obscured by the rest of the model. To resolve this, I want to try to compare the angle vector of this teardrop model to the viewpoint to see if the model is obscured.

I think I have half of what I need by using the command

Code:
viz.MainWindow.screenToWorld([0,5,0.5]).dir
To get a vector representing what the camera is looking at. What I need is a vector in the same coordinate system as this screenToWorld direction vector to determine if the pointer is being obscured by itself.
__________________
Reply With Quote