pybullet.ER_BULLET_HARDWARE_OPENGL and ER_TINY_RENDERER exposed (for getCameraImage, renderer=pybullet.ER_BULLET_HARDWARE_OPENGL)

improve performance of getCameraImage when using ER_BULLET_HARDWARE_OPENGL
This commit is contained in:
Erwin Coumans
2017-03-09 17:42:59 -08:00
parent 4ea9fa54bb
commit ca31bb2bbd
4 changed files with 58 additions and 32 deletions

View File

@@ -29,7 +29,8 @@ for pitch in range (0,360,10) :
viewMatrix = pybullet.computeViewMatrixFromYawPitchRoll(camTargetPos, camDistance, yaw, pitch, roll, upAxisIndex)
aspect = pixelWidth / pixelHeight;
projectionMatrix = pybullet.computeProjectionMatrixFOV(fov, aspect, nearPlane, farPlane);
img_arr = pybullet.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, lightDirection,lightColor)
#getCameraImage can also use renderer=pybullet.ER_BULLET_HARDWARE_OPENGL
img_arr = pybullet.getCameraImage(pixelWidth, pixelHeight, viewMatrix,projectionMatrix, lightDirection,lightColor,renderer=pybullet.ER_TINY_RENDERER)
w=img_arr[0]
h=img_arr[1]
rgb=img_arr[2]