Is there an equivalent backward visibility for three. Js?

I have a grid object that uses a translucent png texture.

Is there a flag or option for MeshBasicMaterial so that the back of the object is visible in front?

Here is a sample code:

var texture = THREE.ImageUtils.loadTexture('world.png');

// create the sphere material
var sphereMaterial = new THREE.MeshBasicMaterial({
    map: texture,
    transparent: true,
    blending: THREE.AdditiveAlpha
});

sphereMaterial.depthTest = false;

// set up the sphere vars
var radius = 50, segments = 20, rings = 20;

// create a new mesh with sphere geometry -
var sphere = new THREE.SceneUtils.createMultiMaterialObject(
    new THREE.SphereGeometry(radius, segments, rings),[
    sphereMaterial,
    new THREE.MeshBasicMaterial({
        color: 0xa7f1ff,
        opacity: 0.6,
        wireframe: true
        })
   ]);

This will accurately display the sphere, but the back side will remain invisible.

+5
source share
2 answers

A new way to do this is to use a property side material.

Example:

new THREE.MeshPhongMaterial( { map: texture, side: THREE.BackSide } )

Possible values are THREE.FrontSide, THREE.BackSide, and THREE.DoubleSide.

See: https://github.com/mrdoob/three.js/wiki/Migration

+20
source

The backface property is set in the grid itself:

sphere.doubleSided = true;
+7
source

All Articles