![]() |
Object rotation
Hello,
There are two points P1 and P2. Is there any simple way using Vizard commands to superpose the object (cylinder) with the vector which starts at P1 and ends at P2? In other words: how to rotate the object to make it directed from P1 to P2? Thanks. |
I believe the following code should accomplish this:
Code:
object.translate(P1) |
Thanks, but unfortunately
|
The code I posted should work if the cylinder is oriented along its local z-axis. If the cylinder is oriented upward along its local y-axis, then you would need to perform another pre-rotation after the lookat.
Code:
object.translate(P1) |
Thank you very much, it works now.
|
All times are GMT -7. The time now is 11:41 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC