LDraw to Web


Re: LDraw to Web
#3
Roland Melkert Wrote:
-------------------------------------------------------
> Are you multiplying the reference type 1 line
> (4x4) matrix recursively with the parent's
> matrices?
>
> And if so, are you multiplying in the right order?
> (backwards)


I'm not sure I entirely understand what you're asking, let me further illustrate what I'm exactly doing...

Here's some quick pseudo code of what I'm trying to do:

//Parent File one-liner
1 0 -20 -36 0 0 1 0 0 0 1 1 0 0 fullbeam.dat
// x y z a b c d e f g h i


//fullbeam.dat sub-file one-liner
3 16 44 0 4 44 2 4 44 0 10
// u v w u v w u v w

foreach VertexPoint in fullbeam.dat{
u' = (a * u) + (b * v) + (c * w) + x;
v' = (d * u) + (e * v) + (f * w) + y;
w' = (g * u) + (h * v) + (i * w) + z;
}

So, with the 3 vertices that are listed in the fullbeam.dat:

Loop 1
u' = (0*44) + (1*0) + (0*4) + -20
v' = (0*44) + (0*0) + (1*4) + -36
w' = (1*44) + (0*0) + (0*4) + 0

Loop 2
u' = (0*44) + (1*2) + (0*4) + -20
v' = (0*44) + (0*2) + (1*4) + -36
w' = (1*44) + (0*2) + (0*4) + 0

Loop 3
u' = (0*44) + (1*0) + (0*10) + -20
v' = (0*44) + (0*0) + (1*10) + -36
w' = (1*44) + (0*0) + (0*10) + 0


So my resulting transformed coords for line 3 in fullbeam.dat would be:
1 0 -20 -32 44 -18 -32 44 -20 -26 44
Reply
« Next Oldest | Next Newest »



Messages In This Thread
LDraw to Web - by Nick McBride - 2011-09-09, 19:32
Re: LDraw to Web - by Roland Melkert - 2011-09-09, 21:32
Re: LDraw to Web - by Nick McBride - 2011-09-11, 15:22
Re: LDraw to Web - by Roland Melkert - 2011-09-11, 17:21
Re: LDraw to Web - by Nick McBride - 2011-09-11, 20:11
Re: LDraw to Web - by Nick McBride - 2011-09-13, 15:58
Re: LDraw to Web - by Jim DeVona - 2011-09-17, 14:37
why not use JavaScript ? - by Steffen - 2011-09-27, 17:44

Forum Jump:


Users browsing this thread: 1 Guest(s)