Points to plane

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/05/2011 at 16:52, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   12&11.5 
Platform:   Windows  ; Mac  ;  Mac OSX  ; 
Language(s) :   C.O.F.F.E.E  ;

---------
Hi all !

I'm trying to orient an object in the same direction than a plane generated by 3 selected points ...

I have my 3 points and their coordinates, but I can't find what I should calculate to make them a reference plane with a correctly oriented axis.

Thanks for all suggestions...

Mike

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/05/2011 at 19:52, xxxxxxxx wrote:

Three points are all you need to define a plane (p1, p2, p3).  Select one point as an arbitrary 'origin' (p1) and the other two become the other ends of direction vectors that also contain that point (p2-p1 and p3-p1).  So, you have to vectors which define the plane.  From there you can determine a normal on the plane (perpendicular to the planar surface) using a cross product ((p3-p1) x (p2-p1) = normal).  If you normalize all the vectors (make them to be within a length of 1.0) and orthonormalize them (make them mutually perpendicular) you will have the correctly oriented axis of the plane.

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/05/2011 at 00:43, xxxxxxxx wrote:

Ok, and then how can I orient my other object like this plane ?

Thank you

Mike

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/05/2011 at 06:48, xxxxxxxx wrote:

Ok now my axis is correctly placed and orientated, but it's sheared... When I do a reset system on it becomes ok.

How can I reset it in my script ?  (I would like to avoid using CallCommand)

Thanks

Mike

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/05/2011 at 07:24, xxxxxxxx wrote:

Howdy,

Use the cross product to square up your matrix starting with your plane's normal vector.

So, for example if your plane's normal vector is the Y axis, then you use either:
XAxis cross YAxis = ZAxis;
YAxis cross ZAxis = XAxis;
ZAxis cross XAxis = YAxis;
or
YAxis cross ZAxis = XAxis;
XAxis cross YAxis = ZAxis;
ZAxis cross XAxis = YAxis;

Adios,
Cactus Dan

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 13/05/2011 at 07:36, xxxxxxxx wrote:

Thanks I'll try tonight !

Mike