頑張ってトレースしたヒゲおじさんボックス画像を貼り付ける。
コードの基本形はこちら
□ three.jsテンプレート。ボックス一つ表示
http://qiita.com/39_isao/items/d1cb35d30a309568dc28
hoge.js
// loaderオブジェクトを作って、画像をロード次第、mesh作成
var loader = new THREE.TextureLoader();
loader.load("block.jpg", function(texture){
createBox(texture); // mesh作成
render();
});
function createBox(texture){
box = new THREE.Mesh(
new THREE.BoxGeometry(100, 100, 100),
new THREE.MeshLambertMaterial({map: texture}) // {map: texture}がキモ
);
box.position.set(0, 0, 0);
// シーンに追加
scene.add(box);
}
function render(){
// レンダリング処理ごにょごにょ
}