We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Home Forums General Questions Loading gLTF material

Tagged: 

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #1576

    so it worked for you?

    Chief 3D Verger | LinkedIn | Twitter

    #1580
    nikolstrek
    Customer

    No :)

    #1581

    The 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.

    Chief 3D Verger | LinkedIn | Twitter

    #1582
    nikolstrek
    Customer

    Thank you, Yuri. I will try it.

    #2747
    nikolstrek
    Customer

    Hi. 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.

    #2755

    Make sure your UV name matches the UV field in the Texture node. If they don’t match your texture won’t be applied correctly.

    Chief 3D Verger | LinkedIn | Twitter

    #2771
    nikolstrek
    Customer

    Yes, 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.

    #2776

    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.

    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.

    Chief 3D Verger | LinkedIn | Twitter

    #4103
    nikolstrek
    Customer

    Hi. 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.

    #4113
    nikolstrek
    Customer

    Oh, I have found a solution. All work fine. :)

    #4116

    :good:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 11 posts - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.