Add Bullet C API and pybullet API to set projective texture matrices.

This commit is contained in:
yunfeibai
2018-03-18 18:45:54 -07:00
parent fd7aa8d0e1
commit 37696dd87e
12 changed files with 82 additions and 7 deletions

View File

@@ -25,8 +25,12 @@ if (useRealTimeSimulation):
while 1:
if (useRealTimeSimulation):
p.getCameraImage(300, 300, lightColor=[1.0,0.0,0.0], renderer=p.ER_BULLET_HARDWARE_OPENGL, flags=p.ER_USE_PROJECTIVE_TEXTURE)
camera = p.getDebugVisualizerCamera()
viewMat = camera[2]
projMat = camera[3]
#An example of setting the view matrix for the projective texture.
#viewMat = p.computeViewMatrix(cameraEyePosition=[7,0,0], cameraTargetPosition=[0,0,0], cameraUpVector=[0,0,1])
p.getCameraImage(300, 300, renderer=p.ER_BULLET_HARDWARE_OPENGL, flags=p.ER_USE_PROJECTIVE_TEXTURE, projectiveTextureView=viewMat, projectiveTextureProj=projMat)
p.setGravity(0,0,0)
sleep(0.01) # Time in seconds.
else:
p.stepSimulation()