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 / 11068
11067  |  11069
Subject: 
Re: LDForge - dev. plans and call for help
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 31 Mar 2010 22:14:06 GMT
Viewed: 
28005 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



Message is in Reply To:
  Re: LDForge - dev. plans and call for help
 
--snip-- (...) 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 (...) (14 years ago, 31-Mar-10, to lugnet.cad, FTX)

12 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