WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Rotating objects about a point (https://forum.worldviz.com/showthread.php?t=6306)

josephredfern 02-19-2020 08:54 AM

Rotating objects about a point
 
Hello,

I have have a list of nodes (returned from viz.addChild). I wish to rotate all of these models about the Y axis of a single point (specifically, 180 degrees). What is the best way to do this? I've tried using setCenter (setting the new center to the position about which I wish to rotate each model) in combination setEuler without success...


Thank you,
Joe

Jeff 02-19-2020 10:02 PM

You can parent all the nodes to a group node and set its position to the point you want the nodes to rotate around.

josephredfern 02-20-2020 01:15 AM

Hi Jeff,

Thank you for your reply.

I've ended up doing the following:

* Create a group
* Set center (not position) of group to rotation point
* Add objects to scene (viz.addChild), specifying position and setting parent to the newly created group

Setting the position of the group rather than the centre made the models be added relative to the new position -- unless I was missing something.


All times are GMT -7. The time now is 06:52 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC