| | Re: LDForge - dev. plans and call for help
|
|
(...) I see.. but problem is that if I use glEnable(GL_DEPTH_TEST) then my polygons won't render at all. Tutorials related to OpenGL explicitly told not to use GL_DEPTH_TEST because of this.. how did you avoid it? (15 years ago, 31-Mar-10, to lugnet.cad, FTX)
|
|
| | Re: LDForge - dev. plans and call for help
|
|
(...) 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 (...) (15 years ago, 31-Mar-10, to lugnet.cad.dev, FTX)
|
|
| | 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)
|
|
| | Re: LDForge - dev. plans and call for help
|
|
(...) If you prefer not to sort at all you can use glEnable(GL_POLYGON_STIPPLE) for transparent polygons. It doesn't look nearly as good, but it's really easy to code. Have fun, Don (15 years ago, 31-Mar-10, to lugnet.cad, FTX)
|
|
| | Re: LDForge - dev. plans and call for help
|
|
(...) The only polygons that LDView sorts are transparent ones. Everything else is handled by the OpenGL depth buffer (glEnable(GL_DEPTH_TEST), followed by glDepthFunc(GL_LEQUAL)). Transparent polygons need to be sorted before being drawn, and (...) (15 years ago, 31-Mar-10, to lugnet.cad, FTX)
|