WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-16-2010, 02:24 PM
imperialkat imperialkat is offline
Member
 
Join Date: Jan 2010
Posts: 9
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.
Reply With Quote
  #2  
Old 02-16-2010, 06:35 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
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.
Reply With Quote
  #3  
Old 02-17-2010, 01:43 PM
imperialkat imperialkat is offline
Member
 
Join Date: Jan 2010
Posts: 9
That helped out a lot. Thanks.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Semi-circle array containing target and distractor objects ptjt255 Vizard 3 08-04-2009 04:09 AM
multiple objects durf Vizard 1 04-10-2009 02:42 PM
Lightwave objects rotation problem hosier Vizard 6 02-13-2009 01:04 PM
Moving multiple objects with ppt durf Vizard 1 02-10-2009 04:03 PM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 12:01 PM


All times are GMT -7. The time now is 11:24 PM.


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