Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mydoghasworms | |
Old Version | Published before Godot 3 was released. |
I am trying to apply a material with a texture to a simple 3D object in Godot. The mesh is just a cube imported from a .obj file exported from Blender.
When I run the scene, it does not seem to apply the material.
Here is a link to my project file: https://drive.google.com/open?id=0B7BEZKRdO750akhuTHJpR19rcTQ
It contains a scene with a cube and a material with a texture image that I simply created inside Godot.
This is what I get when I run the scene:
Did you generate an UV map on your cube before exporting it from Blender? (your link doesn’t contain the original obj file).
Zylann | 2016-12-12 14:03
I did not. Is that a prerequisite? I thought I could just apply materials in Godot. The .obj contains the default scene cube along with a default material (stored in cube.obj and cube.mtl respectively).
–cube.obj:
# Blender v2.78 (sub 0) OBJ File: ''
# www.blender.org
mtllib cube.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 -0.0000 -0.0000
vn 0.0000 0.0000 -1.0000
usemtl Material
s off
f 1//1 2//1 3//1 4//1
f 5//2 8//2 7//2 6//2
f 1//3 5//3 6//3 2//3
f 2//4 6//4 7//4 3//4
f 3//5 7//5 8//5 4//5
f 5//6 1//6 4//6 8//6
– cube.mtl
# Blender MTL File: 'None'
# Material Count: 1
newmtl Material
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
mydoghasworms | 2016-12-13 04:21