#Visible Triangles of an Object

9 messages · Page 1 of 1 (latest)

granite stump
#

I need to remove the triangles of object facing opposite to the camera (i.e. they aren't visible). How can I directly remove them, or perhaps get their ids?

sleek cave
red patio
#

You need to make sure the order of your vertex in your faces array image are in the right order

granite stump
granite stump
sleek cave
#

The most straightforward way would be to just do the math yourself — compute the triangle's normal, take the dot product with your camera facing vector, and check its sign.

granite stump
#

yes, I can write the code manually. but then how do I make it fast, because the triangles are in millions?

sleek cave
#

How fast does it need to be? The time to do the multiplies and compares should be a fraction of the time needed to actually export the triangle data.

red patio
#

Web workers if it's manageable. If not, shaders it is. Never did shaders for vertex computations in three thi