Subject:
|
Re: *** LDView Version 1.9.5 Released ***
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Thu, 30 May 2002 21:28:13 GMT
|
Viewed:
|
690 times
|
| |
| |
In lugnet.cad, Travis Cobbs writes:
> In lugnet.cad, Don Heyse writes:
> > I finally got to try it out and I'm quite jealous of the smoothing
> > feature! I'm gonna have to borrow some of that code!
>
> Feel free, but be warned that it makes extensive use of my custom
> foundation classes...
Classses? Objects? Destructors? Instances? Don't worry, I won't be
borrowing much of that. So far ldglite is just plain C code and I'm
not planning on spoiling it with any of that nasty OOP stuff at this
point. ;^)
I was just thinking about lifting the algorithm with a liberal amount of
global replacing to filter out all the C++ elements. I usually find this
easier than typing the whole thing from scratch, even though it's probably
more work in the long run. (I tend to procrastinate more when starting
with a blank slate.)
> Also, it only works in LDView because I flatten parts internally (equivalent
> to an automatic inline). I don't think the smoothing can be done at the
> part level (as opposed to the DAT file level) without performing this step.
I'll have to see how to work that one. I know the L3 parser keeps track
of which files are PARTS, but I'm not sure how easy it is to traverse the
tree structure and make it appear flat to the smoothing algorithm. On the
other hand I do have an inliner in ldglite and it didn't strike me as
particularly hard to write.
> I think I'll add antialiased lines to my list of future features. I already
> draw the lines last, so that's not a problem.
You should definitely do it! I think it's less than 10 lines of code to
antialias them and they look much, much better. The hard part for me in
ldglite was breaking it into multiple passes. The antialiasing was easy.
Just try this before you draw the lines.
glEnable( GL_LINE_SMOOTH );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST ); // GL_FASTEST GL_DONT_CARE
glEnable( GL_BLEND );
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
On my ancient hardware I don't notice any speed difference. And from
what I read about lines in openGL, they're already slow on a lot of
the hardware accelerators, so this may not slow it down there either.
The only other thing I do to make it look good is draw the line endpoints
with glPointSize() when glLineWidth is set wider than a pixel. I do this
before the drawing the lines, and don't bother with GL_POINT_SMOOTH.
This way the lines blend into the endpoints and you don't get those ugly
rectangular line ends.
Don
|
|
Message has 1 Reply: | | Antialiasing lines and printed polygons
|
| (...) Another nifty thing to do is to draw the printed polygons (type 3 and 4 lines in ldraw that don't use color 16) a second time in GL_LINE mode and antialias them along with the type 2 and type 5 edge lines. This gives you a nice cheap (...) (22 years ago, 9-Jul-02, to lugnet.cad.dev)
|
Message is in Reply To:
| | Re: *** LDView Version 1.9.5 Released ***
|
| FUT lugnet.cad.dev. (...) Feel free, but be warned that it makes extensive use of my custom foundation classes. Also, while you're welcome to use the TCFoundation library (LDView compiles it to a static .lib), you should be aware that it uses (...) (22 years ago, 30-May-02, to lugnet.cad, lugnet.cad.dev)
|
25 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|