POV-Ray : Newsgroups : povray.general : Calc matrix coefs Server Time: 30 Sep 2020 00:34:34 GMT
 Calc matrix coefs (Message 1 to 9 of 9)
 From: kurtz le pirate Subject: Calc matrix coefs Date: 25 Dec 2019 08:01:41 Message: <5e031765\$1@news.povray.org>
```Hello,

I have tow *identicals* triangles T0 and T1
T0 is "at the origin" : <0,0,0>, <a,0,0>, <b,c,0>

T1 is somewhere in space. The coordinates of the three points of the
triangle T1 are known.

How to calculate rotations/translation to "move" T0 to T1 ?

_Merry Christmas_
--
Kurtz le pirate
Compagnie de la Banquise
```
 From: jr Subject: Re: Calc matrix coefs Date: 25 Dec 2019 09:25:00 Message:
```hi,

kurtz le pirate <kur### [at] gmailcom> wrote:
> I have tow *identicals* triangles T0 and T1
> T0 is "at the origin" : <0,0,0>, <a,0,0>, <b,c,0>
>
> T1 is somewhere in space. The coordinates of the three points of the
> triangle T1 are known.
>
> How to calculate rotations/translation to "move" T0 to T1 ?
> Thank you for your help...

the docunentation tells me that 'transforms.inc' has two complementary macros,
'vtransform()' and 'vinv_transform()'.  apparently , you can use the second to
reverse the action of the first, so given you can transform T1 to origin, maybe
that will help?

regards, jr.
```
 From: Melody Subject: Re: Calc matrix coefs Date: 25 Dec 2019 10:30:00 Message:
```"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> kurtz le pirate <kur### [at] gmailcom> wrote:
> > I have tow *identicals* triangles T0 and T1
> > T0 is "at the origin" : <0,0,0>, <a,0,0>, <b,c,0>
> >
> > T1 is somewhere in space. The coordinates of the three points of the
> > triangle T1 are known.
> >
> > How to calculate rotations/translation to "move" T0 to T1 ?
> > Thank you for your help...
>
> the docunentation tells me that 'transforms.inc' has two complementary macros,
> 'vtransform()' and 'vinv_transform()'.  apparently , you can use the second to
> reverse the action of the first, so given you can transform T1 to origin, maybe
> that will help?
>
>
> regards, jr.

do you want the triangle center? there are 5.heh. incenter() is most "central"

to translate is to move it - subvectors.
translate T0 - T1

to rotate, consider your axis, long story .. heh.
gotta know your centers and sine cosine laws, there are about a dozen trig funcs
you need, or just stay home. see triangulation.inc

here a couple centers..

#macro incenter(A,B,C)
#local a = C*vlength(A-B);
#local b = A*vlength(B-C);
#local c = B*vlength(C-A);
#local d = vlength(A-B)+
vlength(B-C)+
vlength(C-A);
#local result = (a+b+c)/d;
result
#end
#macro centroid(A,B,C)
#local result = (A+B+C)/3;
result
#end

if you dont have this stuff, you're like crippled in 3D

Functions:

sss_area(a,b,c)
sas_area(s,a,s2)
bh_area(b,h)           Base Height

sss_height(a,b,c)      height to side2
sas_cos(s,a,s2)        Side Angle Side - solve length of missing side

aas_sin(a,b,s)         AAS solve opposing side of angle2 (b)
asa_sin(a,s,b)         ASA solve opposing side of angle2 (b)
sss_cos(a,b,c)         SSS solve angle opposite side2    (b)
ssa_acute(s,s2,a)      SSA solve angle opposite side2
```
 From: Melody Subject: Re: Calc matrix coefs Date: 25 Dec 2019 10:50:00 Message:
```example rotate matrix, used on lego plane_10.

#local E = vnormalize(vcross(Right,U));
// #declare r = vnormalize(vcross(y,e));
// #declare u = vnormalize(vcross(e,r));
// #declare e = vnormalize(vcross(r,y));
object { plane_10(1,0,1,0,0,0,0,frame,frame,0,60,60,90,90,0,0,0)
scale .007
rotate 90*y
pop_matrix(Right, U, E)
translate (campos - U*.64) + (U*.045) + Eye * 4
.....
WHICH DIRECTION is right up eye?
use the included cross-product order.

could have rotated both up and eye around right, didnt have to.
vcross() : cross product is not a length of 1, normalize.

I use the rotation(r,axis,p) in triangulation.inc, refused to learn another
parameter order. and another in triangulation.inc

#macro pop_matrix(A, B, C)
transform {
matrix <A.x, A.y, A.z,
B.x, B.y, B.z,
C.x, C.y, C.z, 0, 0, 0>
}
#end
```
 From: Tor Olav Kristensen Subject: Re: Calc matrix coefs Date: 25 Dec 2019 22:55:00 Message:
```kurtz le pirate <kur### [at] gmailcom> wrote:
> Hello,
>
> I have tow *identicals* triangles T0 and T1
> T0 is "at the origin" : <0,0,0>, <a,0,0>, <b,c,0>
>
> T1 is somewhere in space. The coordinates of the three points of the
> triangle T1 are known.
>
> How to calculate rotations/translation to "move" T0 to T1 ?
> Thank you for your help...

Hello Kurtz

Perhaps some of what I posted in this thread may be of help to you:

Newsgroup: povray.text.tutorials
Subject: How to transform a triangle into another
Date: 2002-10-02 23:41:55
From: Tor Olav Kristensen

--
Tor Olav
http://subcube.com/
https://github.com/t-o-k
```
 From: kurtz le pirate Subject: Re: Calc matrix coefs Date: 26 Dec 2019 08:28:17 Message: <5e046f21\$1@news.povray.org>
```On 25/12/2019 23:53, Tor Olav Kristensen wrote:

> Perhaps some of what I posted in this thread may be of help to you:
>
> Newsgroup: povray.text.tutorials
> Subject: How to transform a triangle into another
> Date: 2002-10-02 23:41:55
> From: Tor Olav Kristensen
>
>

yes, yes... seems really very very interesting.
especially the two macros : Triangle2Triangle_Trans and
TriangleToTriangle_Trans macros.

very thanks for that.

--
Kurtz le pirate
Compagnie de la Banquise
```
 From: jr Subject: Re: Calc matrix coefs Date: 27 Dec 2019 01:25:00 Message:
```hi,

"Melody" <nomail@nomail> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > ...
> do you want the triangle center? there are 5.heh. incenter() is most "central"
>
> to translate is to move it - subvectors.
> translate T0 - T1
>
> to rotate, consider your axis, long story .. heh.
> gotta know your centers and sine cosine laws, there are about a dozen trig funcs
> you need, or just stay home. see triangulation.inc
> ...
> if you dont have this stuff, you're like crippled in 3D
> ...

uh, maths I don't know and my geometry is, um, shaky?  five centres?  I need to
do some reading.  anyway, cannot see a 'triangulation.inc', suspect it must be
one of yours.

regards, jr.
```
 From: Bald Eagle Subject: Re: Calc matrix coefs Date: 27 Dec 2019 02:05:00 Message:
```"jr" <cre### [at] gmailcom> wrote:

> uh, maths I don't know and my geometry is, um, shaky?  five centres?

Yeah - I delved into this a while back (2014?) when doing some things with
triangles and bubbles and propellers, ....
Friedrich Lohmueller's analytical geometry tools include file has a bunch of
these.

I made a diagram in VISIO - I'll have to dig that up and post it, if I haven't

> I need to

Yes.  :D

> anyway, cannot see a 'triangulation.inc', suspect it must be
> one of yours.

```"Bald Eagle" <cre### [at] netscapenet> wrote: