ROTSTEP questions


ROTSTEP questions
#1
Hello all, I've been working on ROTSTEP support for LDCad 1.6 but I have some questions regarding the spec / general behavior of these meta's.

First what is the base orientation (the one for step 1) to be used while calculating the step's orientation using the REL option.

I've been using this:
   

Second is it correct to assume the "ROTSTEP 0 0 0 ABS" will turn out an upside down image (as LDraw is y negative orientated).

.png   abs.png (Size: 39.31 KB / Downloads: 99)


And then there is the REL option should it act like so when rotating an already rotated model using the x axis only.
   

Hope these issues are clear so experienced rotstep users can help me refine the feature.

Also if someone could donate an (semi) large model using lots of rotstep metas with an known expected output would be very useful.
Reply
RE: ROTSTEP questions
#2
(2016-04-21, 22:37)Roland Melkert Wrote: Hello all, I've been working on ROTSTEP support for LDCad 1.6 but I have some questions regarding the spec / general behavior of these meta's.
That's great, Roland. I'm a volunteer as a tester.

About the spec: for me as a user, it's simple: please agree with the current LPub maintainer so both LDCad and LPub3D shows the model in the same way. That's what matters.
Reply
RE: ROTSTEP questions
#3
(2016-04-23, 15:15)Milan Vančura Wrote: That's great, Roland. I'm a volunteer as a tester.

About the spec: for me as a user, it's simple: please agree with the current LPub maintainer so both LDCad and LPub3D shows the model in the same way. That's what matters.

Thanks Milan the mpd you mailed me opened a can of worms for me though as it made me realize the step meta is literally used as the "end of step" indication while I was using it more as a "start of next step" one in LDCad thus all the rotations are currently applied one step later Smile. This can be fixed of course, I just can't help feeling it to be a bit illogical though (adding the rotation info AFTER the parts are inserted. But it is inline with the LDraw standard it just didn't matter when using non ROTSTEP ones.

Second issue I uncovered is the REL variant seems to apply <meta param matrix> * <default view matrix> in the LPub generated pdf's while the MLCad specification says it should do the reverse. but as I don't want to break the whole booklet world I will do the same, just curious on where this went wrong Smile

And last: Anyone has the default view orientation matrix as used in Lpub? I'm currently using a approximation but an LDraw type 1 reference line like matrix notation of it would be very handy. I'll make it an option so people can change it if needed.

Also any more MPD's are welcome especially ones using the ADD and ABS variants together with expected output pdf's
Reply
RE: ROTSTEP questions
#4
(2016-04-23, 20:42)Roland Melkert Wrote: And last: Anyone has the default view orientation matrix as used in Lpub?

I don't know for sure, but I suspect that it is latitude 30, longitude 45 in lat/long spherical coordinates. Here is my OpenGL-compatible code for initializing the matrix in LDView; I'm pretty sure that's the same as what's in LPub:

Code:
void LDrawModelViewer::setupIsoViewAngle(void)
{
   rotationMatrix[0] = (TCFloat)(sqrt(2.0) / 2.0);
   rotationMatrix[1] = (TCFloat)(sqrt(2.0) / 4.0);
   rotationMatrix[2] = (TCFloat)(-sqrt(1.5) / 2.0);
   rotationMatrix[3] = 0.0f;
   rotationMatrix[4] = 0.0f;
   rotationMatrix[5] = (TCFloat)(sin(M_PI / 3.0));
   rotationMatrix[6] = 0.5f;
   rotationMatrix[7] = 0.0f;
   rotationMatrix[8] = (TCFloat)(sqrt(2.0) / 2.0);
   rotationMatrix[9] = (TCFloat)(-sqrt(2.0) / 4.0);
   rotationMatrix[10] = (TCFloat)(sqrt(1.5) / 2.0);
   rotationMatrix[11] = 0.0f;
   rotationMatrix[12] = 0.0f;
   rotationMatrix[13] = 0.0f;
   rotationMatrix[14] = 0.0f;
   rotationMatrix[15] = 1.0f;
   examineLatitude = 30.0f;
   examineLongitude = 45.0f;
}
Reply
RE: ROTSTEP questions
#5
(2016-04-24, 4:59)Travis Cobbs Wrote: I don't know for sure, but I suspect that it is latitude 30, longitude 45 in lat/long spherical coordinates. Here is my OpenGL-compatible code for initializing the matrix in LDView; I'm pretty sure that's the same as what's in LPub:
Thanks Travis that translates into

0.707 0 0.707 0.354 0.866 -0.354 -0.612 0.5 0.612

Which is the same as the default in LDView (I should have realisded LPub uses LDView to render Smile  )

I just had to correct to LDraw coord system (a 180 rotate around X-axis, or 1, -1, -1 scale) to compensate for the neg y-axis.

which gives.
0.707 0 0.707 -0.354 -0.866 0.354 0.612 -0.5 -0.612

I assume LDView does that somewhere later on?

I'll make the above part of main.cfg so it is adjustable.
Reply
RE: ROTSTEP questions
#6
(2016-04-24, 19:21)Roland Melkert Wrote: I assume LDView does that somewhere later on?

I can't remember where LDView does the coordinate flip/rotate to have +X right +Y down, and +Z into the screen when applying an identity matrix as the "rotation", but yes, it does that separately.
Reply
RE: ROTSTEP questions
#7
(2016-04-23, 15:15)Milan Vančura Wrote: That's great, Roland. I'm a volunteer as a tester.

About the spec: for me as a user, it's simple: please agree with the current LPub maintainer so both LDCad and LPub3D shows the model in the same way. That's what matters.

I've been playing with lpub4 and it seems the "ROTSTEP  ADD" commands are not supported, it reverts back to the default rotation when used. So I'm going to follow the MLCad spec on that one.

I must say it is all very confusing as LPub seems to be working directly with the ldview longitude latitude stuff instead of rotation matrices and on top of that the Y/X axis flips happen somewhere afterwards inside LDView.

So I'm going to count on user feedback to get this stuff 100% "LPub like" in a couple of weeks once I've finished the first 1.6 alpha.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)