bulletphysics / bullet3

Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
http://bulletphysics.org
Other
12.22k stars 2.85k forks source link

Object orientation is not right #4272

Open AisyahJeff95 opened 2 years ago

AisyahJeff95 commented 2 years ago
image

I have a problem which the object I loaded using createvisualShapeId and collisionShapeId seems to be standing like there is an invisible spring there (I am guessing the orientation is wrong?). It supposed to be laying down on the flat surface.

Why does this happen? does it have anything to do with my OBJ file that I created in Blender? This is my code for loading it: `shift = [0, 0, 0] meshScale=[obs_size,obs_size,obs_size]

creating stackable tool:

visualShapeId = p.createVisualShape(shapeType=p.GEOM_MESH, fileName="stack_5.obj", rgbaColor=[1, 1, 1, 1], specularColor=[0.4, .4, 0], visualFramePosition=shift, visualFrameOrientation=[0,0,0,1], meshScale=meshScale) collisionShapeId = p.createCollisionShape(shapeType=p.GEOM_MESH, fileName="stack_5.obj", collisionFramePosition=shift, meshScale=meshScale) stack_list=[] for stack_position in stack_coor: stack_list.append(p.createMultiBody(baseMass=50, baseInertialFramePosition=[0, 0, 0], baseCollisionShapeIndex=collisionShapeId, baseVisualShapeIndex=visualShapeId, basePosition=stack_position, useMaximalCoordinates=True))`

zhao666-cloud commented 2 years ago

if or not the simulation time is too short.