Fernando JS
Fernando JS

Reputation: 4317

Three.js - Issue to render objects using CanvasRenderer

I'm facing a issue to render cubes using CanvasRenderer, depends the camera position any cubes lost same parts and show a part of face other cube, as the below images:

In this example, there are two cubes, when the camera in front there aren't problem:

enter image description here

But, when I change de camera:

enter image description here

To render I use a array of materials, this is one of:

  new THREE.MeshLambertMaterial({ color: 0x006600, ambient: 0xffff00, side: THREE.DoubleSide, overdraw: 0.5 }),

Upvotes: 0

Views: 420

Answers (1)

WestLangley
WestLangley

Reputation: 104763

What you are seeing is an artifact of CanvasRenderer. The best you can do is tessellate your geometry. For example,

var geometry = new THREE.BoxGeometry( 100, 100, 100, 4, 4, 4 );

Or better yet, switch to WebGLRenderer.

three.js r.70

Upvotes: 1

Related Questions