Plane Generator strange faces count

yanomano's picture

Is it normal to have 8012 faces and 8014 normals generated for a plane as :

widht: 4006 Height : 1

PreviewAttachmentSize
StrangePlane.png
StrangePlane.png41.19 KB

yanomano's picture
triangles !

Ok i forgot no quads ! just triangles ! ;)

cwright's picture
yep

As you noticed, triangles. So facecount is Width * Height * 2 (2 triangles per quad).

for normals, it's a bit stickier: we could cheat and just make 1 and re-use it, but we make a bunch instead, so smoothing/deforming has less work to do (since few people hopefully use kineme3d to just render planes). To calculate the number of normals, you have to calculate the number of vertices, which is calculated with (Width+1) * (Height+1)

yanomano's picture
Plane generator with quads?

Do you think this is possible ? When i play with the plane generator and the ripple patch , i have noticed that normals make some "light clic" when their orientation change. I suspect this kind of thing to be more clean with quads...

yanomano's picture
Force normals orientations ?

Or perhaps check normals and give the same orientation to the ones that have a 45° verticles between ?

PreviewAttachmentSize
Force same orientation.png
Force same orientation.png12.27 KB

cwright's picture
no magic

Quads are top-secretly just 2 triangles. I promise. OpenGL really doesn't do anything magical -- if all 4 points aren't coplanar to will do exactly the same thing.

The Kineme3D engine is entirely geared around triangles, rewriting it all to handle quads would be error prone and not too beneficial*.

(*) -- yes, then you could do quad outlines, but that's about the only gain.

cwright's picture
degeneracy

those aren't 45° angles (because the triangles are 3x as tall as they are wide). And with that, you can see that this isn't automatically possible. What if the center quad was flipped around? you'd have 5 edges hit some corners, and 3 edges on others. figuring out which ones are quad-like is a ton of work. And in many cases, there simply aren't any quad-like structures, so you'd get garbage out.

yanomano's picture
Quad cylinder

Yes ! bad eyes maths ;) Sorry to come always with quads request chris ;) But how do they do that : apple quad cylinder... Have you try to reverse enginering it to see ? Where are hidden the ultra-top-secretly triangles here ?...;)

PreviewAttachmentSize
AppleCylinder.png
AppleCylinder.png62.62 KB

cwright's picture
below

Below, I noted that using quads will get you quad wireframes. But they're still rendered as 2 triangles. It's not difficult, it's just that Kineme3D isn't at all geared towards quads (faces are basically hard-coded to always be 3 vertices, otherwise we have to do per-face inspection for mixed triangle/quad meshes. And if we just say "a mesh is only ever quads or triangles", then they can't be mixed (not that much can mix presently anyway...)).