WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Exponential Scaling (https://forum.worldviz.com/showthread.php?t=483)

Wenamun 01-19-2006 01:19 PM

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

tobin 01-23-2006 09:11 PM

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


All times are GMT -7. The time now is 01:58 AM.

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