Three objects JS objects (PlaneGeometry)?

I have a question about sizes:

var geometry = new THREE.PlaneGeometry(50, 50); var plane = new THREE.Mesh(geometry, material); plane.doubleSided = true; plane.tile = tile; 

So the question is: are the dimensions of the PlaneGeometry, not the pixels to the right? When I have aroun 500x500 canvas, will it be less than 50x50 at the end?

PS> Another question, how to get the size of an element when it is already added to the scene? Thanks!

+4
source share
2 answers

50x50 is not a pixel. These are "units." Regardless of what you want a "unit" (this is relative to the size of other objects).

If you want to resize the object in a controlled way, you can do this:

 var geometry = new THREE.PlaneGeometry(1, 1); var plane = new THREE.Mesh(geometry, material); plane.scale.x = 50; plane.scale.y = 50; 
+11
source

PS> Another question, how to get the size of an element when it is already added to the scene? Thanks!

I am using the thingiview js plugin, and I noticed that if you have an object added to the scene, you can close it in a cube using the Coordinates:

p0 = [minx, miny,minz], p1 =[minx,miny,maxz], ..., p7 =[maxx, maxy,maxz];

Where:

var minx = object.geometry.min_x; var maxz = object.geometry.max_z;

etc..

PS: I know this question is old, but I was looking for these parameters (trying to get the size of the added object), but could not find anything.

0
source

All Articles