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
Related
I am using THREE.MeshLine from https://github.com/spite/THREE.MeshLine to try and draw lines in three.js. The lines appear to work when using a perspective camera to view the scene as the demos showed, but when I use an orthographic camera which is the camera I need to use for my project, the line is distorted.
For now, I am trying to make sure that the line works by creating a sin wave, but with the ortho camera, it looks like this:
Why does the mesh not display correctly with an orthographic camera? Are there any ways to fix this or achieve orthographic lines with a thickness in three.js?
This is a know issue, see https://github.com/spite/THREE.MeshLine/issues/118.
The wide line implementation of three.js does support orthographic cameras, though.
I'm trying to render texture to material but it rendered is not correctly, maybe my texture is wrong, but when i add the texture in blender it renders correctly. I don't know why.
Sorry I just learned threejs, but the current project needs to render in 3d. So I came here to ask if anyone has a solution, please help me.
Here is my Codesanbox:
https://codesandbox.io/s/hero-kdhox?file=/src/App.js
The texture I have added in Blender something like this:
https://imgur.com/dYkD5u8
You must flip your textures vertically, threejs will by default flip them when you import them using 'useLoader' there is a property flipY for textures but it hasn't been working reliably
Your best bet is to flip them vertically manually before importing
Alternatively, pack the textures in your GLB on blender itself
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.
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 got a problem with texturing an object in Unity 3D. I have made a simple object in 3Ds Max and inserted it into Unity and then tried to apply an image as texture but it does not apply the texture and it only changes the color of the object! This is the print screen:
As you can see I have got two models. One of them is made in 3Ds Max and does not apply the texture and the other one is made in Unity and it's a cube and it gets the texture correctly.
So what's going wrong here ? Not that I also changed the tiling and offset settings of model's shader but still nothing's changed at all! :(
You didn't UV Unwrapped the 3d object before exporting to Unity3D.
To apply the textures on 3d mesh, any engine needs to know coordinates for texture, and this is called UV Mapping.
WIKIPEDIA - UV_mapping