0

In order to simulate a specific production process in Blender I need to ensure that the scene's gravity "down" is aligned with the viewport's angle.

In other words in this case:

enter image description here

"Down" should be along the x-axis, like this:

enter image description here

I know I can get the view matrix and decompose it like this:

t, r, s =  bpy.context.space_data.region_3d.view_matrix.decompose()

and I can get/set the scene's gravity like with

bpy.context.scene.gravity

How do I combine the two so that things always fall "from" the viewpoint and "towards" the point being looked at?

simone
  • 745
  • 4
  • 14
  • It sounds like you want top view. Numpad 7 gives you top view and numpad 5 toggles between orthographic and perspective. If you do want to manipulate the viewport viewpoint see this answer – Marty Fouts Nov 15 '21 at 22:17
  • @MartyFouts - thanks, but actually, no: I want to simulate the process of glueing of a patch onto a curvy surface withminimal distortion: this process would not always happen along the Z axis – simone Nov 16 '21 at 06:10
  • Did you see the answer I posted the pointer to? It shows how to do the combining. Isn't that what you want? – Marty Fouts Nov 16 '21 at 14:41
  • Yes, I did. Maybe it’s me but I don’t get the connection - apart from getting the rotation matrix. Should I brush up on matrices and vectors instead of asking questions? – simone Nov 16 '21 at 18:13
  • I can't know what do and don't already know, so I have to ask when things I thought might help didn't so I can figure out how to help. I also have to ask questions to make sure I understand what you really want. – Marty Fouts Nov 16 '21 at 18:33
  • Sure! That’s the way I read it, and I appreciate you doing that. Sorry if it came across otherwise. And my question was without sarcasm - it could be that working harder on understanding matrices would get me there – simone Nov 16 '21 at 18:48

0 Answers0