As it is well known, threejs.org recommends using gltf for models.
I'm trying to use a simple shape (plane) with a texture.
When I export from Blender 2.97b the shape appears 180 degrees rotated so I rotate the shape in Blender to avoid rotating it in three.js.
The real problem is that the texture always appears rotated vs the mesh, no matter what I tried. Has anyone imported gltf from Blender? I wonder if anything will ever work properly when using Blender...
Blender export settings I use for gltf 2.0:
export selected only
convert z-up to y-up
export texture coordinates
export normals
export materials
I have installed pipeline via node.js and each time I convert and compress to .glb based on the Khronos info here:enter link description here
I also use a Three.MeshBasicMaterial and assign the png image as a map.
Related
I'm trying to understand the use of vertex colors on imported models within three.js.
In my use case, I have a source DXF file, which has been converted to a glTF file using Assimp.
When I import the resulting glTF file into Sketchfab, the 3d model displays all the correct and original colors that were used within the source DXF file.
When I import the same glTF file into three.js however, the colors are all different.
Within both three.js and Sketchfab the materials applied to each object within the scene are set to use vertex colors.
Can someone please explain why these results might be different, or any approach I could take to maintain the original colors within three.js
Link to the glTF file
Link to the glTF .bin file
Threejs export part of the Object3ds faces as image after teture has been added trough uv map.
I this even possible ?
EDIT:
I want to export part of my 3d object with texture applied so that i can print that part on sheet of paper
I'm trying to load a skinned mesh from blender into a THREE.js scene, but it... looks a little odd:
There is a skeleton that was loaded from the animation only, the mesh modified for the game, and there is a little one that is directly loaded from the three.js ObjectLoader.
It's supposed to look more like this (from blender):
I found it!
when exporting from blender, I modified the number of influences to 4. It appears that some vertices were being modified by more than one bone and therefore when only two influencing bones were exported it distorted.
I have the collada pump example working fine. I'm now trying to export an animated dice with 1 texture but in the threejs I only see the shape of the dice with no texture. The animation works fine.
Also the lighting on the dice looks wrong.
I can load the collada file in other program with no problems.
I'm using this version of threejs: https://cdnjs.cloudflare.com/ajax/libs/three.js/r72/three.js
anyone?
ADDED: I have create an example with a cube and one texture. In this example you can see that the texture is not on the cube: http://sigmaphp.dk/threejscollada.zip
I had create a dice in blender and then export it to three.js but when I load it in the scene then it showing up inverted.
http://www.sggame.bugs3.com/dice.html
I done it in blender software by flip the normals inside of the object and recalculate the normals. then agiain export it to three.js