PRoblem: i’m trying to create (just for fun) a simple poker card (with a card back and a card front).
I have two different images, for back and front.
I easily created a Plane geometry with a single texture for both sides, but i really don’t know how to assign a texture for a side and the other texture for the other side…
i tried this (without success 🙁 ):
var textureBack = new THREE.ImageUtils.loadTexture( 'images/cardBack.png' );
var textureFront = new THREE.ImageUtils.loadTexture( 'images/cardFront.png' );
var material1 = new THREE.MeshBasicMaterial( { map: textureBack } );
var material2 = new THREE.MeshBasicMaterial( { map: textureFront } );
var geometry = new THREE.PlaneGeometry( 90, 110, 1, 1 );
geometry.faces[ 0 ].materials.push( material1 );
geometry.faces[ 1 ].materials.push( material2 );
var card = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial());
any help, please? 🙂
You need to place two plane geometries back-to-back.
First, create a geometry for the front.
Now create another geometry for the back.
Spin it 180 degrees.
After you load the materials, create the meshes, and add them as children of a “card” object.
You’ll have an easier time with this if you use
WebGLRenderer.Fiddle: http://jsfiddle.net/mdAb7/11/
Updated to three.js r.69