Comments (2)
Working with this more (I'm doing a transparency sorting project for my game engine project) it looks like its implementation is fundamentally incorrect because it only splits triangles that are compared to the inserted triangle along its insertion path.
Instead it should split every triangle with respect to all triangles' planes and then sort them by plane. I'll post a follow-up reply after I've implemented something.
EDITED: https://github.com/GerardMT/BSP-Tree/blob/master/src/bsp_tree.cpp has some code. It looks like it might help to section the polygons into half-spaces as an optimization, but I'm pretty sure that's not what the bsptree.cc code is accomplishing because I've drawn its cuts as a wireframe and it's way more irregular than that, and I can't see how it would work from any vantage point to produce sorted transparency. Although I admit I haven't seen any glitches with my own eyes yet.
from mm3d.
Follow-up: https://github.com/mick-p1982/mm3d/blob/widgets95-ui/src/libmm3d/bsptree.cc now shows code that uses a linked-list to store polygons inside the BSP nodes. An added benefit is coplanar polygons should all end up in the same node together. I think it's correct.
Edited: The code that sets it up is in model.cc. It calls addTriangles
on each group with transparent effects, and then partition
.
from mm3d.
Related Issues (20)
- Material/light parameters are backward, should be swapped HOT 2
- 1.3.13 Minor Animation Issue When Starting New Animation HOT 2
- md3filter.cc DBL_MIN should probably be -DBL_MAX HOT 1
- Groupwin (Clean up) doesn't remove materials (as advertised)
- Zero divide is missing from normalize/normalize3 (glmath.h/glmath.cc) functions HOT 2
- edgedivcmd.cc reverses addTriangleToGroup's args HOT 1
- glmath.h operator-= and += don't return & reference
- Model>Edit Model Meta Data... does not save changes HOT 1
- Request to not antialias the Paint Texture image HOT 6
- Opening and Immediately Closing
- After creating triangle using "Make face from vertices", allow "Invert normals" to operate on this newly added triangle HOT 2
- Adjustable radius and strength options for attract tools.
- Support spacemice HOT 3
- two years passed without release HOT 3
- Grid snapping? HOT 1
- I want to report one issue and one question HOT 8
- Add Pixelated Texture view HOT 1
- Animation mode won't allow moving verticies on Linux HOT 3
- Export to WRML/WRL (for Kicad models)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mm3d.