Subject:
|
Re: LDForge - dev. plans and call for help
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Wed, 31 Mar 2010 22:14:06 GMT
|
Viewed:
|
29111 times
|
| |
| |
In lugnet.cad, Timothy Gould wrote:
|
--snip--
|
Sorting by the distance to the centroid is only an approximation, but its
good enough to look pretty good for transparent polygons. Its not good
enough to be used as the primary means of hiding geometry thats 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 youve 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 Im 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 triangles 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 (...) (15 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
|
|
|
|