Re: how to transform objects not using Transform3D
Posted by
Mr. Broccoli on
Jul 30, 2022; 10:31pm
URL: https://forum.jogamp.org/how-to-transform-objects-not-using-Transform3D-tp4041515p4041803.html
Hi Phil,
I believe I have managed to split cube_one into IndexedtriangleArrays, consisting of 1 triangle each, 12 geometries per cube.
It took me a while, trial and error in debug mode, to understand what is happening behind the scenes with the coordinates, vertices and indexes, but I think it works now.
I have also tweaked updateData calls. These are not the cutest, but for now they work.
Have a look
notusingtransform3D.javaIs it possible you expand a bit on draw order in renderField?
I understand, that each triangle has a front and a back face.
Assuming triangle's back face should never be visible, then there's no point in displaying that triangle if we see its back face. Then, the remaining front-facing triangles shall be displayed per z order.
Now, how can I check/know if the triangle is properly oriented and the back face's normal is directed towards the inside of a cube? I created these triangles counter-clockwise, looking at each face from opposite to each face's normal direction, as per Wikipedia tutorial page.
How can I extract and use information on normals?
For the z-order, the idea I have is that I calculate average Z per triangle vertices and sort these geometries per that value.
Any hints/remarks/useful methods for what I'm about to do?
Thanks, Mr. B