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
« 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 that solution will also work for pad computers - by Steffen - 2011-09-27, 17:50 Re: that solution will also work for pad computers - by Roland Melkert - 2011-09-27, 19:27 Re: that solution will also work for pad computers - by Jamie B. - 2011-11-04, 19:20 Re: that solution will also work for pad computers - by Roland Melkert - 2011-11-04, 19:43 WebGL in action in a similar application - by Steffen - 2011-11-04, 21:08 Re: that solution will also work for pad computers - by Jamie B. - 2011-11-09, 2:42 Re: that solution will also work for pad computers - by Orion Pobursky - 2011-11-05, 0:01 question to forum admins: merge 3 threads? - by Steffen - 2011-11-27, 12:54

Forum Jump:

Users browsing this thread: 1 Guest(s)