POV-Ray : Newsgroups : povray.general : Calc matrix coefs Server Time
6 Oct 2024 09:01:09 EDT (-0400)
  Calc matrix coefs (Message 1 to 9 of 9)  
From: kurtz le pirate
Subject: Calc matrix coefs
Date: 25 Dec 2019 03: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 ?
Thank you for your help...



_Merry Christmas_
-- 
Kurtz le pirate
Compagnie de la Banquise


Post a reply to this message

From: jr
Subject: Re: Calc matrix coefs
Date: 25 Dec 2019 04:25:00
Message: <web.5e0329e5ce9dbf348c662f470@news.povray.org>
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.


Post a reply to this message

From: Melody
Subject: Re: Calc matrix coefs
Date: 25 Dec 2019 05:30:00
Message: <web.5e033972ce9dbf349da690110@news.povray.org>
"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:
  inneradius(a,b,c)      3 lens
  outeradius(a,b,c)

  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


Post a reply to this message

From: Melody
Subject: Re: Calc matrix coefs
Date: 25 Dec 2019 05:50:00
Message: <web.5e033d81ce9dbf349da690110@news.povray.org>
example rotate matrix, used on lego plane_10.

 #local U = rotation(radians(flightpitch),Right,Up);
 #local E = vnormalize(vcross(Right,U));
  // #declare E = rotation(radians(flightpitch),Right,Eye);
  // #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


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Calc matrix coefs
Date: 25 Dec 2019 17:55:00
Message: <web.5e03e85dce9dbf34bb9e5a860@news.povray.org>
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

http://news.povray.org/povray.text.tutorials/thread/%3C3D9B843D.E5392CD0%40hotmail.com%3E/

--
Tor Olav
http://subcube.com/
https://github.com/t-o-k


Post a reply to this message

From: kurtz le pirate
Subject: Re: Calc matrix coefs
Date: 26 Dec 2019 03: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
> 
>
http://news.povray.org/povray.text.tutorials/thread/%3C3D9B843D.E5392CD0%40hotmail.com%3E/


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


Post a reply to this message

From: jr
Subject: Re: Calc matrix coefs
Date: 26 Dec 2019 20:25:00
Message: <web.5e055cf0ce9dbf348c662f470@news.povray.org>
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.


Post a reply to this message

From: Bald Eagle
Subject: Re: Calc matrix coefs
Date: 26 Dec 2019 21:05:00
Message: <web.5e0565bfce9dbf344eec112d0@news.povray.org>
"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
already...

> I need to
> do some reading.

Yes.  :D

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

http://news.povray.org/povray.general/thread/%3C470e5314%40news.povray.org%3E/


Post a reply to this message

From: Bald Eagle
Subject: Re: Calc matrix coefs
Date: 26 Dec 2019 21:15:01
Message: <web.5e056836ce9dbf344eec112d0@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:

> Yeah - I delved into this a while back (2014?) when doing some things with
> triangles and bubbles and propellers, ....

See:
http://news.povray.org/povray.binaries.images/thread/%3Cweb.53e25769ad990c965e7df57c0%40news.povray.org%3E/?ttop=429330
&toff=800


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.