WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-03-2009, 09:36 AM
durf durf is offline
Member
 
Join Date: Feb 2009
Posts: 61
Gravity

Hello,

I have made a 2d array of pillars. I am trying to make all of these pillars drop to a certain plain. I am just a little confused about what I need to do. Below is the code that pertains to my nested for loops which create the pillars. I have looked into viz.gravity() and figured that is the best route. Just not sure where or really how to impliment this.

Code:
 
columns = [-20, -10, 0, 10, 20]
rows = [0, 6, 12, 18]
pillars = []

for x in columns: #creates an array of pillars
     for y in rows:
          pillar = OrginalPillar.copy()
          pillar.translate(0+x, 0, 0+y)
          pillar.setScale(1,1,1)
          pillar.visible(viz.OFF)
          pillars.append(pillar)

number = 0
def showPillar():
      globae number
      pillars[number.visible(viz.ON)
      number += 1
vizact.ontimer2(.5,len(pillars)-1,showPillar)
Reply With Quote
  #2  
Old 03-04-2009, 11:47 AM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
The viz.gravity command changes the force of gravity on the viewpoint when viz.collision is on. This will not help you with your pillars =(

But, there's hope. You can use Vizard's physics engine to move the pillars. There are tutorials in Vizard's help that will get you started with the physics engine.

If you just need the pillars to fall and sit there all nice and stable you could move them manually each frame with a timer and this physics function:

yPosition = initialPosition + initialVelocity*secondsPassed + .5*gravitysAcceleration*secondsPassed*secondsPasse d

For the pillars this function would probably look like this:
yPosition = 0 + 0 + .5*-9.8*secondsPassed*secondsPassed
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 07:52 AM.


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