LoginSignup
3
1

More than 5 years have passed since last update.

【three.jsのヘルパー解説集】 ④BoxHelperの使い方

Posted at

BoxHelper

継承:THREE.Line
解説:オブジェクトの境界エリアを可視化してくれるヘルパーです。BoundingBoxHelperと似ていますが、こちらはMeshではなくLineで構成されています。境界エリアだけを確認したい場合はこちらを使用をオススメします。

デモ

Untitled.gif

実装例

javascript
var sphere = new THREE.SphereGeometry();
var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );
var box = new THREE.BoxHelper( object );
scene.add( box );

BoxHelper(object, color)

  • object:境界を表示させたいObject3Dオブジェクト
  • color:boxのラインの色
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1