Trin Posted June 28, 2010 Report Share Posted June 28, 2010 Hi Lavas, I've used pickpoint method in the attached VI to implement a "point marking" functionality. I've also disabled the camera contoller and implemented my own "rotate" routine which is based on "set rotation.vi". The point marking works fine at VI start but if the object is rotated, it marks the wrong points on the window area. It seems that after "set rotation.vi" execution the pickpoint method returns wrong coordinations of the point on the object. Should I perform manual updating of model view matrix after "set rotation.vi" execution ?? Any help will be greatly appreciated. P.s; i have attached all the vis and subvis CreateSensor.vi FindNewAxis 8.6.vi Rotate 3D object 8.6.vi Quote Link to comment
vugie Posted June 29, 2010 Report Share Posted June 29, 2010 I didn't run your VIs, but my guess is that you get right coordinates - coordinates for rotated object. Because you place a sensor as a child of main object, its translation is relative to this object. Pick Point gives you absolute coordinates. You decided to use object transformation to mimic camera behavior. This approach has both advantages and drawbacks. The drawback is that you have to apply inverse transformation to each absolute point you get from Pick Point in order to have its relative location. Inverse transformation is easy to calculate: it is still 4x4 matrix with 3x3 rotation component, 3x1 translation component, 3 zeros and 1. You simply has to transpose rotation component (inverse matrix for rotation matrix is always equal to its transposition) and negate translation component. But I advice you rather to use camera as a camera (and either Setup Camera method or changing modelview matrix). Things will be much simpler then. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.