WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-19-2006, 01:19 PM
Wenamun Wenamun is offline
Member
 
Join Date: Jan 2006
Location: Milwaukee Wisconsin
Posts: 11
Exponential Scaling

Hi.
My code scales my model (ball for now) with coordinates from my PPT system.
I would like to be able to scale the model quickly with very little movement from the PPT. Right now it's a one to one ratio.
I've used ppt.command(4.002)
to scale all my numbers by 2, or 5 or ten etc.
But I want exponential growth.

Thanks for any help!

Here's my code:

viz.go()

PORT_PPT = 4

ball = viz.add('white_ball.wrl')
ball.translate(0,2,5)
ppt = viz.add('vizppt.dls')

def ontimer(num):
data = ppt.get()
ball.scale(data[0],data[1],data[2])


viz.callback(viz.TIMER_EVENT, ontimer)
viz.starttimer(1,viz.FASTEST_EXPIRATION, viz.FOREVER)


-Wenamun
Reply With Quote
  #2  
Old 01-23-2006, 09:11 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
I'm rather unclear what you're asking for here, but if you're saying you want the size of the ball to scale exponentially with distance measurements from PPT, then you ought to replace the scale call with an exponential function of the PPT data frather than using the data directly.

Here's a good primer on exponentials:

http://mathworld.wolfram.com/ExponentialFunction.html
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


All times are GMT -7. The time now is 10:46 AM.


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