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 / 2001
2000  |  2002
Subject: 
Re: fixes??
Newsgroups: 
lugnet.cad.dev
Date: 
Mon, 7 Jun 1999 06:55:06 GMT
Viewed: 
1742 times
  
Luckily, you have access to the LDLite source code.
And it is the following lines near the top of stub.c:

// replace pixels within tolerance to avoid rounding problems
#define Z_LINE_TOLERANCE 2

// move lines closer to viewer before drawing to avoid rounding problems
#define Z_LINE_OFFSET 3

The z values are in 1/16ths of an LDRAW-unit.  The Z_LINE_TOLERANCE
is used in case one line is drawn exactly over another, so we make
sure the entire line is replaced rather than some moire pattern
due to rounding.  The Z_LINE_OFFSET works like the "Polygon
Offset".
Playing with these values makes some models look better at some
resolutions and angles. I typically adjust these so that the
file m928.dat by Steven "Wombat" Walter at the standard view
looks the best.  Maybe these need to be tweakable?
-gyug



Leonardo Zide wrote:
> 
> Steve Bliss wrote:
> > 
> > The problem is the primitive stud*.dat files are specifying two different
> > colors for the same voxel (3D pixel)--the voxels are the edges are being
> > filled with both the edge color and the surface color.  So the renderer has
> > to 'decide' which color to use.
> > 
> > Without making drastic changes in the LDraw language, there's not much that
> > can be done.  If the edges are 'cheated' (moved slightly above the surface
> > so they will alway be drawn), they will appear to float above the surface
> > at high resolutions.
> 
>   You don't need to change anything in the LDraw language, you can use
> something called "Polygon Offset" (those who have used OpenGL will know
> what I mean), it moves the lines a little bit to the front when checking
> the Z-buffer. You'd just need to have access to the LDraw source code to
> change that... :)
> 
> Leonardo



Message has 1 Reply:
  Re: fixes??
 
(...) Did you get the changes to the way LDLite saves bitmaps that I submited about 2 months ago ? You haven't told me anything. Leonardo (27 years ago, 7-Jun-99, to lugnet.cad.dev)

Message is in Reply To:
  Re: fixes??
 
(...) You don't need to change anything in the LDraw language, you can use something called "Polygon Offset" (those who have used OpenGL will know what I mean), it moves the lines a little bit to the front when checking the Z-buffer. You'd just need (...) (27 years ago, 2-Jun-99, to lugnet.cad.dev)

10 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
    

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