xeolabs / scenejs

An extensible WebGL-based 3D engine. This is an archived project.
https://xeolabs.github.io/scenejs/
Other
649 stars 165 forks source link

Vertex Optimization #301

Open paulck opened 10 years ago

paulck commented 10 years ago

Hi all,

I just wandering if in SceneJS the only way to define a cube is using 36 vertex or there is another compact way to do that. That would reduce the size (loading time) of the models transimitted. I'm working with bimsurfer so I've noticed a big increase in size between models written in IFC and those serialized for SceneJS

Thanks in advance

biodigital commented 10 years ago

No as far as I know you need all those vertices so that you can provide vertex normals that point in the direction of each face. Each vertex must have exactly one normal vector, and since those vectors can't be shared by positions at corners, you have to have 36 of them. Let me know if you find I've missed something and find a solution..

paulck commented 10 years ago

I this this discussion can be helpful : http://stackoverflow.com/questions/7463607/webgl-triangles-in-a-cube

8 Vertex will be awesome, but even 24 instead of 36 will be nice.