# Rotate parent so child plane is parallel to ground

On 11/04/2015 at 00:23, xxxxxxxx wrote:

I'm trying to rotate a parent object that has a plane for a child so the child plane is parallel to the C4D ground plane.

It isn't quite working.
Once I have the normal of the plane, how do I rotate the parent?
Am I rotating the parent around the center of the plane to do this?

Thanks,

Chris

On 17/04/2015 at 07:41, xxxxxxxx wrote:

Hello,

all you need to do is to handle the matrices of the objects. When you say that the plane should be "parallel" to the ground that means that the plane should not be rotated in world space, right?

So the world space rotation should be zero. The world space rotation of the plane is the result of the world space rotation of the parent plus the local rotation of the plane relative to the parent. So the world space rotation of the plane is zero when the world space rotation of the parent is "minus" the local rotation of the plane.

Sine we are handling rotations as matrices there is no "minus" but you can invert the matrix with the standard Python operator "~".

So the most simple code could look like:

``````
localPlaneMatrix = plane.GetMl()
op.SetMg(~localPlaneMatrix)

``````