09-29-2011 05:56 AM
Sorry that's Shift + Left Mouse Button, not Ctrl.
09-29-2011 06:11 AM
Should really take a time out and say everything in one big post.
To add to my earlier post, you'll also notice in your VI, if you do some zooming then try to click on the object to rotate it (doesnt rotate) the object seems to skip to a new position. Seems like the (x,y) positions once you have done some zooming, don't correspond to actual (x,y) positions in the scene therefore the object skips to what it thinks is its actual position.
You also cannot zoom in/out on the object in your VI, trying holding down Shift + Left Mouse Button, it won't work. Nor does ctrl + Left Mouse Button which changes the axis of the pivot in Spherical Camera Controller mode. I really dont understand why this happens at all.
I tried to bind the Shift key to the scroll wheel using event structures, to avoid all the Matrices, but this method is equally messy. I would assume using the scroll wheel to zoom on 3D picture control should be something straightforward =(
Regards,
Nik
10-12-2011 04:45 AM - edited 10-12-2011 04:46 AM
Hi Nik,
Im sorry it has taken so long to reply to your post. I have had some time to look at the VI again and have tried to accomplish zooming and rotating.
I have altered the VI slightly so that when you rotate it will not rotate around an arbitrary position, but instead rotate the object around a central axis of its own. The way this was achieved was by setting the camera's position to look at a specific point in space (in this case the origin).
Unfortunately after rotation, when you try to zoom again, the model will snap back to its original position before rotation. I believe this is due to the fact that the live camera controls inbuilt into LabVIEW, when you click and drag on the picture, are a virtual representation of the model and do not affect the models physical position or rotation. If you take a look at the inside case and outside case values of the x,y and z position of the model you will see that the information is not passed through or stored when rotating.
I will try to look further into how to store the virtual position information inside the case structure, however in the meantime I would suggest trying to accomplish the rotation by creating a new event structure (similar to your zoom event) which looks for click and drag position.
I hope this helps you, and please do not hesitate to reply with how your project is going, I am very interested to hear if you find an alternative solution to the problem.
Kind Regards,
Laurence C.
Applications Engineer
National Instruments UK
10-12-2011 05:56 AM - edited 10-12-2011 05:59 AM
Hi,
I realise I have forgotten to attach the VI that I had altered. I would have edited the previous post however that option seems to elude me currently.
Regards,
Laurence C.
Applications Engineer
National Instruments UK