Original Post
Hello, Brush-shape is convex polyhedron defined by set of bounding planes. This kind of objects is widely used in Quake 1, 2, 3 engines as base geometric primitive. It provides good base for some algorithms such collision detection, visibility and so on. Each plane is defined by three points. Attributes of the each plane are UV offset, scale and material. So, I want to create node which “produce” mesh which present this polyhedron. I should be able to move and rotate each plane separately, set UV scale and offset and set materials for each. It would be great to allow edge and vertex dragging. There is some math: 1. Vertices coordinates are computed by finding of intersection of all plane triplets. Points of intersection, which appear outside of polyhedron, will be removed. So, here we`ll get vertices: p0, p1, … pn. 2. Normal for each face is the same as normal to enclosing plane. 3. Computing of UV coordinates is depending on orientation of the plane. If X-axis is closest axis to plane normal, UV coordinate for each vertex will computed by following formulas: u = (p.x + u_offset) * u_scale * 128 / tex_width; v = (p.y. + v_offset) * u_scale * 128 / tex_height; Can you advice me what is best way to implement Brush-shape? Thanks a lot in advance. P.S. Sorry for my English :)