Home › Forums › General Questions › Loading gLTF material
Tagged: Material
- This topic has 25 replies, 3 voices, and was last updated 7 years, 8 months ago by
Yuri Kovelenov.
-
AuthorPosts
-
2018-01-08 at 9:18 am #1576
Yuri KovelenovStaff2018-01-08 at 12:08 pm #1580
nikolstrekCustomerNo :)
2018-01-08 at 12:32 pm #1581
Yuri KovelenovStaffThe following code works for me:
var geometry = new v3d.TorusGeometry(); var torus = new v3d.Mesh(geometry); var mat = v3d.SceneUtils.getMaterialByName(v3dApp, "MyMaterial"); torus.material = mat; v3dApp.scene.add(torus);I used a simple colored default material created in Blender. I guess you should try assigning your material to some simple model in Blender first (with no UVs) and see if it works.
2018-01-08 at 2:14 pm #1582
nikolstrekCustomerThank you, Yuri. I will try it.
2018-03-10 at 3:56 pm #2747
nikolstrekCustomerHi. I try to apply a requiring UV material, created in blender, to uploaded in scene model ( with OBJLoader.js), my obj model has a UV but material not applyed this UV, how can I apply UV from .obj model ? Or I only need to calculate UV ?
Thanks.2018-03-12 at 7:35 am #2755
Yuri KovelenovStaff2018-03-12 at 9:46 am #2771
nikolstrekCustomerYes, I know about it. If I export my .obj model into Blender, it has standard UVMap layer. But UV don’t works in a Web scene.
Also I did not find information about a UV map inside an .obj file.2018-03-12 at 4:25 pm #2776
Yuri KovelenovStaffIf I export my .obj model into Blender, it has standard UVMap layer. But UV don’t works in a Web scene.
Also I did not find information about a UV map inside an .obj file.I think this is because Blender automatically create a UV layer named ‘UVMap’, but it is actually absent when you load the obj file directly in the engine. I’d suggest using the glTF format instead.
2018-05-09 at 6:53 am #4103
nikolstrekCustomerHi. I have a quick question.
Can I appy material(like new v3d.MeshStandardMaterial() ) to the model with UV map, with correct unwrapp.I use this code
var material2 = new v3d.MeshStandardMaterial();
var loader = new v3d.TextureLoader();
material2.map = loader.load(‘bake.jpg’ );
material2.map.wrapT = v3d.RepeatWrapping;
material2.map.wrapS = v3d.RepeatWrapping;
material2.needsUpdate = true;and get a result without a UV.
At attached image, right object with a blender material, left with a new v3d material.2018-05-09 at 11:48 am #4113
nikolstrekCustomerOh, I have found a solution. All work fine. :)
2018-05-09 at 1:26 pm #4116
Yuri KovelenovStaff -
AuthorPosts
- You must be logged in to reply to this topic.
