WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-12-2016, 05:23 AM
handerson11 handerson11 is offline
Member
 
Join Date: Nov 2016
Posts: 6
Applying Gravity to a Mesh

Hi,

I am looking to use a mesh on a box and I need it to fall as if being acted on by gravity. What is the best way to trigger the fall action after the box has been picked up and keep the action occurring over a certain height? Also how do I make it stop falling whenever it collides with another object?

This is the simple setup I have at the moment:

Code:
import viz
import vizact
import vizconnect
import vizshape

viz.fov(60)
viz.go()

#fall action
fallAction=vizact.fall(0.75,gravity=9.81)

#adding ground
ground = viz.add('ground.osgb')
ground.collidePlane()

#add cubes
cube1=vizshape.addCube(size=0.5)
cube1.collidemesh()
cube1.setPosition(0,1,1)
cube1.add(fallAction)

cube2=viz.shape.addCube(size=0.5)
cube2.collidemesh()
cube2.setPosition(0,0.5,1)

#define grabbable parts
parts=[cube1]

#using vizconnect
vizconnect.go('vizconnect_config.py')
#grabber
grabber=vizconnect.getRawTool('grabber')
grabber.setItems(parts)
from tools import grabber
tool = grabber.Grabber(usingPhysics=True, usingSprings=True)
tool.setItems(parts)
The technique will later be applied to more complex shapes which is why I am using the mesh instead of the box method.

Thanks
Reply With Quote
 


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
Gravity changes with angle of view in mid-drop?! GregEnj Vizard 1 08-07-2013 11:42 AM
Identify a class via its mesh EnvisMJ Vizard 1 02-15-2012 08:43 AM
Collide mesh on child objects Enlil Vizard 1 08-31-2010 05:52 PM
chain mesh collisions mkmatlock Vizard 1 08-31-2010 12:44 PM
Multiple Mesh Avatar Texturing v-jbinney Vizard 6 11-13-2007 11:00 AM


All times are GMT -7. The time now is 05:15 AM.


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