Jump to content

Can't change texture of imported mesh


Ohad
 Share

Recommended Posts

Hey,

I am trying to change the texture of an imported mesh (exported from Belnder) but it doesn't seem to work.

If you look at my playground project you will see i am trying two things:

  1.  Create my own ground and change it's texture - works fine.
  2. Import Mesh and change it's texture - doesn't work. The mesh change color but doesn't use the texture of the given image.

What am i missing?

Thanks.

 

 

Link to comment
Share on other sites

Hi @Ohad, welcome to the BJS forum... good to have you with us.

Let's take a text-editor browse of your .babylon file...

{"producer":{"name":"Blender","version":"2.77 (sub 0)","exporter_version":"4.6.0","file":"cube.babylon"},
"autoClear":true,"clearColor":[0.0509,0.0509,0.0509],"ambientColor":[0,0,0],"gravity":[0,-9.81,0],
"materials":[],
"multiMaterials":[],
"skeletons":[],
"meshes":[{"name":"Plane","id":"Plane","billboardMode":0,"position":[0,0,0],"rotation":[0,0,0],"scaling":[8.556,8.556,8.556],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"checkCollisions":false,"receiveShadows":false
,"positions":[1,0,-1,-1,0,1,-1,0,-1,1,0,1]
,"normals":[0,1,0,0,1,0,0,1,0,0,1,0]
,"indices":[0,1,2,0,3,1]
,"subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":4,"indexStart":0,"indexCount":6}]
,"instances":[]}
],
"cameras":[{"name":"Camera","id":"Camera","position":[7.4811,5.3437,-6.5076],"rotation":[0.4615,-0.8149,0.0108],"fov":0.8576,"minZ":0.1,"maxZ":100,"speed":1,"inertia":0.9,"checkCollisions":false,"applyGravity":false,"ellipsoid":[0.2,0.9,0.2],"cameraRigMode":0,"interaxial_distance":0.0637,"type":"FreeCamera"}],"activeCamera":"Camera",
"lights":[{"name":"Lamp","id":"Lamp","type":0,"position":[4.0762,5.9039,1.0055],"intensity":1,"diffuse":[1,1,1],"specular":[1,1,1]}],
"shadowGenerators":[]
}

See that?  No uvs were included in the "Plane" export.  I'm sure that many Blender users have had this same problem, so do some forum searches for "Blender" and "uvs" and similar.  I know there are some posts that talk about UV unwrapping and assorted other Blender uv topics. 

I think... when you manage to get uvs included in your .babylon file, then your textures will map-onto the imported mesh... much better.  Keep us posted.   Welcome again.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...