[Bf-blender-cvs] [643aa68] framebuffer: fix example (projection matrix aspect ratio)
Dalai Felinto
noreply at git.blender.org
Tue Oct 20 04:45:34 CEST 2015
Commit: 643aa681b9d8853c38ca996641174d9ae9c5acee
Author: Dalai Felinto
Date: Tue Oct 20 00:45:02 2015 -0200
Branches: framebuffer
https://developer.blender.org/rB643aa681b9d8853c38ca996641174d9ae9c5acee
fix example (projection matrix aspect ratio)
===================================================================
M doc/python_api/examples/gpu.offscreen.1.py
===================================================================
diff --git a/doc/python_api/examples/gpu.offscreen.1.py b/doc/python_api/examples/gpu.offscreen.1.py
index 2febb97..06f0d91 100644
--- a/doc/python_api/examples/gpu.offscreen.1.py
+++ b/doc/python_api/examples/gpu.offscreen.1.py
@@ -52,10 +52,17 @@ class OffScreenDraw(bpy.types.Operator):
@staticmethod
def _update_offscreen(context, offscreen):
scene = context.scene
+ render = scene.render
camera = scene.camera
modelview_matrix = camera.matrix_world.inverted()
- projection_matrix = camera.calc_matrix_camera()
+ projection_matrix = camera.calc_matrix_camera(
+ render.resolution_x,
+ render.resolution_y,
+ render.pixel_aspect_x,
+ render.pixel_aspect_y,
+ )
+
offscreen.draw_view3d(
scene,
More information about the Bf-blender-cvs
mailing list