WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Moving objects together (https://forum.worldviz.com/showthread.php?t=2523)

imperialkat 02-16-2010 01:24 PM

Moving objects together
 
How can I move one object based on where another object is moved?

I'm trying to simulate an object in front of a lens and the image it creates. There's one user-controlled object (A) on one side of the lens and another object (B) on the other side. When the user moves A relative to the lens I need B to 1)move a distance X (not necessarily the same distance) in the opposite direction and 2) change size based on its distance from the lens.

Jeff 02-16-2010 05:35 PM

Use vizact.onupdate() or vizact.ontimer() to call a function every frame where you get the position of objectA. Based on that position or change from the previous frame you can set the new position of objectB and then scale it based on its distance from the lens.

imperialkat 02-17-2010 12:43 PM

That helped out a lot. Thanks.


All times are GMT -7. The time now is 07:23 AM.

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