Rotate object coordinate system

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

dom107
Posts: 35
Joined: Wed Apr 18, 2012 10:04 am

Rotate object coordinate system

Hello,

I'm looking for how to rotate an object coordinate system so that a chosen axis (from the object coordinate system) is normal to an object face.

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany
maybe this helps:

http://wiki.blender.org/index.php/Exten ... cise_Align

otherwise, it's possible to write a python addon to do so, i'm just a little unsure about normal vector to rotation matrix conversion (rather math problem)
I'm sitting, waiting, wishing, building Blender in superstition...

dom107
Posts: 35
Joined: Wed Apr 18, 2012 10:04 am
I was wondering if I had not missed something in Blender functions: well a script is needed for what I'm looking for.

Thanks for the link to the script.
It works but the workflow is somewhat complicated.

I might be writing a script.

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany
i'm stuck at the required math, basically rotation matrix construction :/

however, i know how to do the rest

rough outline:

Code: Select all

`active_ob = bpy.context.active_objectsel_obs = bpy.context.selected_objectssel_obs.remove(active_ob)me = active_ob.dataface_normal = me.polygons[me.polygons.active].normal# construct rotation matrixfor ob in sel_obs:    ob.matrix_world *= rot_mat`

this might be relevant for the mat construction:
http://www.gamedev.net/topic/602485-dir ... on-matrix/
I'm sitting, waiting, wishing, building Blender in superstition...

dom107
Posts: 35
Joined: Wed Apr 18, 2012 10:04 am
I started a script and posted about a few problems here