silentimp Posted April 13, 2014 Share Posted April 13, 2014 Ho.May you help me to find out why material don't apply to loaded from json mesh?http://websaints.net/model/index2.html — loading model with THREE.MeshNormalMaterial() material — ок. http://websaints.net/model/index.html — trying to load with texture — not ok.I create model with makehuman.org,save model as objthen convert obj to json with help of grunt-three-objloading it with THREE.JSONLoaderI think I do everything right … but somewhere I am wrong and get err:Uncaught TypeError: Cannot set property 'needsUpdate' of undefined Code:var angle = .05,scene = new THREE.Scene(),camera = new THREE.PerspectiveCamera(63, 4/3, 0.1, 1000),renderer = new THREE.WebGLRenderer({canvas: document.getElementById("screen"),antialias: true}),json_loader = new THREE.JSONLoader(),model = nulljson_loader.load('http://websaints.net/model/json/human.js', modelLoaded, 'http://websaints.net/model/json/');renderer.setSize(600, 400);camera.position.x = 0;camera.position.y = 0;camera.position.z = -10;function render() {if(model!=null){model.rotation.y+=.05;}requestAnimationFrame(render);renderer.render(scene, camera);}render();function modelLoaded(geometry, materials){model = new THREE.Mesh(geometry, new THREE.MeshNormalMaterial());model.position.z = 10;model.position.y = -8;scene.add(model);camera.lookAt({x:0,y:0,z:0});}With all best regards. Anton. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.