Three.js: PlaneHelper is error at some point

Created on 14 Oct 2018  路  11Comments  路  Source: mrdoob/three.js

Description of the problem

PlaneHelper is error at some point.
Please take a look at this, during scanning, PlaneHelper will be in a wrong direction.
https://codepen.io/karoshi/pen/MPEJeG/
I looked at updateMatrixWorld function, and see this:
this.lookAt( this.plane.normal );
It seems a bug of lookAt function usage.

Three.js version
  • [ ] Dev
  • [x] r97
  • [ ] ...
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Hardware Requirements (graphics card, VR Device, ...)
Help (please use the forum)

Most helpful comment

@whatisor Please see the Plane docs and make sure you understand Hessian Normal Form. Please use the forum if you need more help.

All 11 comments

PlaneHelper.position should not be changed from ( 0, 0, 0 ). It was not designed for that.

I think you should use a mesh with an instance of PlaneBufferGeometry in order to visualize your scanner. PlaneHelper is intended to visualize an instance of Plane which represents a flat, 2D surface that extends infinitely far. The second parameter size only exists to avoid visual clutter when rendering the helper.

@Mugen87 PlaneHelper is designed to visualize a clipping plane. Be careful not to clip the helper, however.

localPlane = new THREE.Plane( new THREE.Vector3( 1.0, 0, 0 ), - 1 );
renderer.localClippingEnabled = true;
material.clippingPlanes = [ localPlane ];

var helper = new THREE.PlaneHelper( localPlane, 20, 0x0000ff );
scene.add( helper );

//

localPlane.constant -= speed; // animate

PlaneHelper is designed to visualize a clipping plane.

If this is its actual purpose, you should call it ClippingPlaneHelper.

If this is its actual purpose, you should call it ClippingPlaneHelper.

Its purpose is to render a Plane. A clipping plane is a special case.

Neither should Box3Helper be renamed to BoundingBoxHelper.

if its pupose is "Its purpose is to render a Plane", I think this still need to be fixed. Because Plane is plane, not only 0 position plane :)

Do you have some idea why lookAt failed? I have no idea of reason...

@whatisor Please see the Plane docs and make sure you understand Hessian Normal Form. Please use the forum if you need more help.

I know the solution. We should create update(plane) API which is consistency with BoxHelper design :)

That means it refers to the original plane, do not need to call an update.

Was this page helpful?
0 / 5 - 0 ratings