To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 17133
Subject: 
Re: LDForge - dev. plans and call for help
Newsgroups: 
lugnet.cad
Date: 
Wed, 31 Mar 2010 21:56:52 GMT
Viewed: 
22806 times
  
--snip--

   Sorting by the distance to the centroid is only an approximation, but it’s good enough to look pretty good for transparent polygons. It’s not good enough to be used as the primary means of hiding geometry that’s farther away from the viewer.

--Travis

Out of interest which centroid do you use? I would have thought that the bounding box center was better than the centre of all corner points (since these cluster around areas of high detail) but you’ve presumably tried different centroid algorithms.

Tim


Subject: 
Re: LDForge - dev. plans and call for help
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 31 Mar 2010 22:14:06 GMT
Viewed: 
28136 times
  
In lugnet.cad, Timothy Gould wrote:
   --snip--

   Sorting by the distance to the centroid is only an approximation, but it’s good enough to look pretty good for transparent polygons. It’s not good enough to be used as the primary means of hiding geometry that’s farther away from the viewer.

--Travis

Out of interest which centroid do you use? I would have thought that the bounding box center was better than the centre of all corner points (since these cluster around areas of high detail) but you’ve presumably tried different centroid algorithms.

For transparency, LDView sorts triangles, and only triangles, not parts. So the centroid of each triangle is (p1 + p2 + p3) * (1/3).

All transparent geometry in the whole model goes into one big list of triangles. While I’m at it, I calculate the centroid for each triangle so I only have to do that at model load time. At the beginning of each frame, I calculate the distance squared to each triangle’s centroid based on the current viewing angle. Then I do a qsort() with those distances. (I used distance squared in order to avoid an unnecessary square root.)

--Travis


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