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 / 10092
10091  |  10093
Subject: 
Rendering implementation details
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 24 Jan 2005 22:02:44 GMT
Viewed: 
1807 times
  
I was envisioning how an LDraw renderer would be implemented if it were
done with OpenGL, and I've arrived at some questions that I can't answer
for myself.

I'm particularly wondering about line type #5, the optional line.
According to the LDraw file format specification: "This draws a line
between the first two points, if the projections of the last two points
onto the screen are on the same side of an imaginary line through the
projections of the first two points onto the screen."   I understand
what this means, but I'm confused about certain details of
implementation that could, as near as I can see, be the cause of some
inefficiency.

For this line type, using OpenGL one thing I came up with was that one
would use gluProject on each vertex on both line segments to see where
they would fall on screen, examine the end points, and then decide
whether or not to draw them based on that, but I would imagine calling
gluProject 4 times for each optional line listed in a part definition
(especially since not all of them are necessarily even displayed!) would
adversely affect performance.   The only other way I could see it
working is to do _all_ the rendering in the application, and not rely on
something like opengl at all.  Again, I would imagine this to severely
impact performance.

Could anyone enlighten me as to how this could be done without making
serious compromises in efficiency?  Or am I completely out to lunch
about the performance impact of the concerns I've mentioned?

Thanks in advance.
>> Mark



Message has 3 Replies:
  Re: Rendering implementation details
 
(...) Someone once suggested to me (Dan from Microsoft maybe?) that given today graphics libraries, one could probably get away with ignoring op-lines altogether and use edge detection. This would present a potential problem since edge color is (...) (20 years ago, 24-Jan-05, to lugnet.cad.dev)
  Re: Rendering implementation details
 
(...) You're right about the performance hit. We've discussed this issue previously on lugnet, because quite a few of the renderers out there use opengl (ldview, leocad, ldglite, Mac Brick Cad...) Source code is available for all of these if you (...) (20 years ago, 25-Jan-05, to lugnet.cad.dev)
  Re: Rendering implementation details
 
(...) I'm not sure it's possible to implement for real without serious slowdowns. It might be possible to implement in a vertex program, but I haven't studied vertex programs, so I really don't know. (I'm pretty sure you can't throw out a vertex (...) (20 years ago, 25-Jan-05, to lugnet.cad.dev)

22 Messages in This Thread:







Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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