0
votes

I'm new to both Blender and ThreeJs and searched a lot before asking. I created a model with Blender and esported it as .dae so I can load it in the html canvas. The problem is that only the model is loaded and not the textures. I'm doing something wrong or it's the loader that somehow causes the problem?

Here is the sample: http://provasitimek.herobo.com/firstImport2.html

and the code: https://github.com/MarcinKwiatkowski1988/learningThreeJs/tree/master/ThreeJs_and_blender

PS. the blender version is 2.70 (so maybe the problem lays here?)

PS2: So, after many attempts, these are my conclusions:

  1. to get the color of the object, you have to choose the Blender renderer and not Cycles renderer
  2. the export to the file .dae is not realy significant, should working with all options (or at least I didn't find any differences between files exported with different options)
  3. if you use Blender renderer and any basic materials (Basic, Lambert, Phong) you get only the color on the object rendered in threeJs: so, for example, if you apply a trasparency to you object on blender, you will not see it on the rendered object on threeJs

with my current level (i just started to learn threeJs and blender 2 weeks ago) this is as far as I can help. Hope someone with higher skills like @mrdoob would figure out what the problem is

1
You are linking to a version of the library that is a year old. You are also throwing console errors. Upgrade to the current version of three.js and try again.WestLangley
I took the last three.min from mrdoob, it should be the last: github.com/mrdoob/three.js/blob/master/build/three.min.js And now is not working even the model...MarcinKwiatkowski

1 Answers

0
votes

THREE.js does not pair models and textures until you actually make a mesh. Export The model and texture separately, load them separately and call

new THREE.Mesh(blenderGeometry,blenderTexure)