To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10499
Subject: 
LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 03:18:26 GMT
Viewed: 
2651 times
  
Hello all,

I'm having difficulties with the ldraw coordinate system. As fas I
understood it it's Right handed, just like OpenGL. So

X positive is right
X negative is left
Y Positive is top
Y Negative is bottom
z Positive is front
z negative is back

    Y

    /\
    |
    |
    ----> X
   /
|/_

Z

Please confirm this, I have been reading contradictions.

But let's assume this is correct, then why are all parts drawn upside
down while rendering in OpenGL?

It seems even MlCad is correcting for this by rotating 180 degrees
around the x axis, up becomes -Y and back Z

But why is this? It doesn't fix anything you still got one 'weird' axis
(in non professional people eye's) cuz you got the Y axis in the 'wrong'
way now instead of the Z-Axis.


Just wondering about this, while trying to determine how to orientate
stuff in my new animation software.

Greetings,

Roland


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 03:40:16 GMT
Viewed: 
2608 times
  
In lugnet.cad.dev, Roland Melkert wrote:
X positive is right
X negative is left
Y Positive is top
Y Negative is bottom
z Positive is front
z negative is back

I've always understood it is:

X positive is right
X negative is left
Y Positive is bottom
Y Negative is top
z Positive is back
z negative is front

In fact you can show this by adding a brick in MLCad and moving it around,
watching how the X, Y and Z values change.

ROSCO


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 06:19:32 GMT
Viewed: 
2698 times
  
As I understand it, LDraw has negative y in the up direction, which is neither
right nor left handed, but something else entirely.  I don't know that it has a
name.

James


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 11:00:26 GMT
Viewed: 
2726 times
  
In lugnet.cad.dev, James Reynolds wrote:
As I understand it, LDraw has negative y in the up direction, which is neither
right nor left handed, but something else entirely.  I don't know that it has a
name.

James


It is still a right-handed system. The handedness is unchanged by rotation (in
ldraws case 180*x from standard).

Tim


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 15:00:39 GMT
Viewed: 
2746 times
  
In lugnet.cad.dev, Roland Melkert wrote:
   Hello all,

I’m having difficulties with the ldraw coordinate system. As fas I understood it it’s Right handed, just like OpenGL. So


I’ve been having difficulty with importing/exporting .dat files from SketchUp. In SketchUp, if you stand at the Origin;

X is right, Y is forward, and Z is up.

The LDraw Primitives Reference (http://www.ldraw.org/library/primref/) says the LDraw axes are:

X is right, Y is down, and Z is forward. Here’s the image from the reference page.



So it first seems like a simple 90 degree rotation around the X axis is all you need to convert between SketchUp and LDraw system, but it doesn’t work in practice. I can’t get the 2 systems to agree on an axes system.


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 15:16:12 GMT
Viewed: 
2750 times
  
In lugnet.cad.dev, Jim Foltz wrote:
   In lugnet.cad.dev, Roland Melkert wrote:
   Hello all,

I’m having difficulties with the ldraw coordinate system. As fas I understood it it’s Right handed, just like OpenGL. So


I’ve been having difficulty with importing/exporting .dat files from SketchUp. In SketchUp, if you stand at the Origin;

X is right, Y is forward, and Z is up.

The LDraw Primitives Reference (http://www.ldraw.org/library/primref/) says the LDraw axes are:

X is right, Y is down, and Z is forward. Here’s the image from the reference page.



So it first seems like a simple 90 degree rotation around the X axis is all you need to convert between SketchUp and LDraw system, but it doesn’t work in practice. I can’t get the 2 systems to agree on an axes system.

In LDraw +z is backwards, not forwards or more strictly +Z points away from the camera when X is right and -Y is up.

Tim


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 18:31:55 GMT
Viewed: 
2770 times
  
Hi,

Here’s my box test model in SketchUp. (The above model is the same model unfolded.)



When I export this model to a .dat and open it in LDView, the green side is the top-view, blue is the front view (as expected), and I would expect the right-view to be orange. But I get the red side as the right side.

Here is the right-view in LDView



Any idea how I can translate this on export?


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 18:57:51 GMT
Viewed: 
2822 times
  
In lugnet.cad.dev, Jim Foltz wrote:
   Hi,

Here’s my box test model in SketchUp. (The above model is the same model unfolded.)



When I export this model to a .dat and open it in LDView, the green side is the top-view, blue is the front view (as expected), and I would expect the right-view to be orange. But I get the red side as the right side.

Here is the right-view in LDView



Any idea how I can translate this on export?

That looks like a correct mapping to me. Unless I’m mistaken the red and orange are on the same sides in both pictures. The unwrapped boxes are definitely identical and unless you’ve moved them in one or the other the whole thing is right.

Tim


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 19:48:44 GMT
Viewed: 
2766 times
  
Tim Gould wrote:
  > It is still a right-handed system. The handedness is unchanged by
rotation (in
ldraws case 180*x from standard).

Tim

So the original designer of the LDraw program just decided to use this
orientation of the right handed system. if so then it starts making more
sense to me, I just need to redefine 'front, left, right etc' to fit in
this orientation for editing.

I'll make it an option (LDraw orientation 'standard' orientation).
Because personally I find a upward negative Y very confusing, but I
suspect that the LDraw die hards are custom to it.

But in essence no changes are made to the coordinates (only the camera
position), so it doesn't really matter how you label the sides :)


Roland


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 19:59:03 GMT
Viewed: 
2789 times
  
Jim Foltz wrote:

Any idea how I can translate this on export?

Google uses the right handed system but indeed rotated by 90 degrees,
LDraw also uses the right handed system but 180 degrees rotated.

It should not matter how you show the model, the coordinates are
interchangeable, but if you want to use sketchup for drawing LDraw stuff
you should indeed rotate 90 degrees around the x-axis to get the
standard orientation of parts people expect.

I don't get why LDview switches left and right because the only side's
that change are front/back and top/bottom.

Have you tested in mlcad, there you can see the axis.

Roland


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 19 Nov 2006 22:24:42 GMT
Viewed: 
2861 times
  
In lugnet.cad.dev, Timothy Gould wrote:
   In lugnet.cad.dev, Jim Foltz wrote:
   Here is the right-view in LDView



Any idea how I can translate this on export?

That looks like a correct mapping to me. Unless I’m mistaken the red and orange are on the same sides in both pictures. The unwrapped boxes are definitely identical and unless you’ve moved them in one or the other the whole thing is right.

I agree with Tim. It looks fine to me. If there were any mirroring going on, then either the orange and red would be swapped on the unwrapped box, or the green and grey would be swapped.

The picture in LDView has a rotated camera angle relative to the one in Sketchup, but the geometry remains unchanged.

--Travis


Subject: 
Re: LDraw coordinate system driving me crazy
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 20 Nov 2006 07:23:02 GMT
Viewed: 
3008 times
  
A sincere thanks to all of you. Your comments made me go back over (again) my export code, and I found an error. Now it works as expected. I was getting funny rotations because I mis-ordered the elements of the transformation matrix, duh. Seems obvious in hindsight.

Yea! Now I can draw right-side-up. (Helmet done in SketchUp.)




©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR