Creating a BoxBufferGeometry() with anything less than all first three parameters (width, height, depth) results in an instance that has its attributes.position partially to completely filled with NaN.
jsFiddles: rev dev - check console for both of them
Doing so with BoxGeometry results in box.vertices with just one to four Vector3 elements, depending on how many parameters were supplied.
The same is also true for PlaneBufferGeometry and PlaneGeometry:
https://github.com/mrdoob/three.js/blob/095e9d328a85fff318ca5052e7ad956cb1cd72fd/src/geometries/PlaneGeometry.js#L35-L49
width and height are never set.
Other geometries avoid this by having defaults, for comparison:
https://github.com/mrdoob/three.js/blob/095e9d328a85fff318ca5052e7ad956cb1cd72fd/src/geometries/CircleGeometry.js#L51-L55
https://github.com/mrdoob/three.js/blob/095e9d328a85fff318ca5052e7ad956cb1cd72fd/src/geometries/CylinderGeometry.js#L60-L69
Good find! I think it can't hurt to define some default values. Maybe the following:
BoxBufferGeometry: 10 for width, height and depth
PlaneBufferGeometry: 10 for width, height
@mrdoob @WestLangley Are these values okay for you?
We also need to update the docs.
I think 1 is better as default value (1 meter).
Agreed, I would expect a default box to be 1x1x1.
I'm also fine with 1 馃槉
@moraxy Do you want to make this change?
@Mugen87 feel free to go ahead, I'm currently battling git and merge conflicts anyway 馃槕
Most helpful comment
Good find! I think it can't hurt to define some default values. Maybe the following:
BoxBufferGeometry:10forwidth,heightanddepthPlaneBufferGeometry:10forwidth,height@mrdoob @WestLangley Are these values okay for you?
We also need to update the docs.