cubegeometry diagonal issue in three js

I need to create CubeGeometry with wireframe but without diagonals, I used BoxHelper but I cannot color cube. Can any one suggest me how to color cube using BoxHelper.

Answers


You have several options. Here are the patterns to follow:

var mesh = new THREE.Mesh( new THREE.BoxGeometry( 10, 10, 10 ), new THREE.MeshNormalMaterial() );
//scene.add( mesh ); // optional

var helper = new THREE.BoxHelper( mesh );
helper.material.color.set( 0x00ffff );
scene.add( helper );

// alternate method
var helper = new THREE.EdgesHelper( mesh, 0xff0000 );
scene.add( helper );

Here is a fiddle to help you: http://jsfiddle.net/Lv2jseLb/

note: CubeGeometry has been renamed to BoxGeometry.

three.js r.84


Need Your Help

Get post from Google+ without browser's authentication in google's account via PHP

php session authentication google-plus posts

I'm want to get google+ posts via PHP, but google requires my login via browser.

How to make notification intent resume rather than making a new intent?

android android-activity android-intent notifications resume

What i have here is a simple webview activity that when loaded it auto displays an ongoing notification. The idea is that people can navigate away from this activity and quickly access it again fro...