Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get the number of polygons in a scene?

With three.js , is there a way to retrieve the polygon count of a scene? I did a search, but the only results that pop up at related to actual polygons and whether meshes have too many, etc.

like image 646
user3591153 Avatar asked Sep 06 '25 17:09

user3591153


2 Answers

I believe renderer.info.render.faces may be what you're after.

like image 131
msun Avatar answered Sep 10 '25 17:09

msun


[ Update ] On Three.js revision r100 you would get that data through:

renderer = new THREE.WebGLRenderer();
// Code that loads your geometry here
console.log( renderer.info.render.triangles );

This same object has several a lot of data that can give you a hint over your memory leaks, so you might just want to console log the whole renderer object and browse all of its properties!

like image 39
Xedret Avatar answered Sep 10 '25 17:09

Xedret