PDA

View Full Version : rotation problem


krimble
11-21-2007, 09:18 AM
Hi all,

I have a problem with ive\osg, obj, wrl objects, The pivotpoint in 3ds max is at the edge of the object.
The object is not in the center of the world. When I export the object, Vizard imports it exactly at the right place
(the same place as in 3ds max), that's great!. But when I apply the following action.

opendoor = vizact.spin(0,1,0, 20, 5)
furniture_objects[key].addAction(opendoor)

The animation starts, but the pivot is at the 0,0,0 position of the world....

With furniture_objects[key].center(2,0,0) it seems moving the whole object to (2,0,0) ?


How do I get the right rotationPoint for a object in Vizard ?


Thank u,

farshizzo
11-21-2007, 10:22 AM
The center() command should not be moving the object. It simply sets the rotation pivot point. Are you sure you are setting the center to the correct location? Here is an example that uses the cone model that comes with Vizard.import viz
viz.go()

#Setup environment
viz.add('tut_ground.wrl')
viz.clearcolor(viz.SKYBLUE)
viz.move(0,0,-20)

#Spin cone
cone = viz.add('tut_cone.wrl')
cone.addAction(vizact.spin(0,1,0,90))Since the cone if offset 8 meters from the origin it will spin around the origin. Now add the following code to the script:cone.center(0,0,8)Now the center is placed at the cones location, so it will spin around its local origin.