mrdoob/three.js — Issue #1358: blender export color
Author: corsaronero
Created: 2012-02-19 16:53:27+00:00
State: open

Hi
I have one probem
I have a balloon created with blender exported three.js
when I load the red balloon is not smooth but has many square

Thanx

var container = document.getElementById( 'container' );

camera = new THREE.PerspectiveCamera( 10, window.innerWidth / window.innerHeight, 1, 1000 );
camera.position.y = - 6;
camera.position.z = 100;

scene = new THREE.Scene();

var light = new THREE.DirectionalLight(0xffffff);
light.position.set(0, 0, 1).normalize();
scene.add(light);

loader = new THREE.JSONLoader();
loader.load('obj/balloon-tutorial.js', function (geometry) {
geometry.materials[0].shading = THREE.FlatShading;

mesh = new THREE.Object3D();
mesh.position.x = 0;
mesh.scale.x = mesh.scale.y = mesh.scale.z = 1;
scene.add(mesh);
geometry.computeVertexNormals();
var part1 = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial());

mesh.add(part1);

var part2 = new THREE.Mesh(geometry, new THREE.MeshNormalMaterial({ color: 0xffffff, shading: THREE.FlatShading, overdraw: true }));
mesh.add(part2);

});

renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );