owl-project / NVISII

Apache License 2.0
319 stars 27 forks source link

Add textures to imported obj file #151

Open blenzig opened 1 year ago

blenzig commented 1 year ago

is it possible to add a texture from a file to an entity/mesh created with a obj file?

I create the entity using: obj = nvisii.entity.create( name=object, mesh = nvisii.mesh.create_from_file("object", "object.obj"), transform = nvisii.transform.create("object"), material = nvisii.material.create("object") )

I create the texture using: nvisii.texture.create_from_file("tex_object", "texture.jpg") And then set the texture with: nvisii.material.get("object").set_base_color_texture(tex_klt)

The object in the rendered images just changes to color to a kind of grey. I also tried different obj files and texture.jpg files with the same result. When i use a nvisii.mesh.create_box mesh the textures looks perfect!

any idea?

blenzig commented 1 year ago

image Even with procedural textures i get the same problem. I used the same noise generated texture with set_base_color_texture() on both entities but get a very different look.

blenzig commented 1 year ago

With the bmw.obj model it is working kind of correclty. Is the dragon obj file structure different from the bmw file? 06_textures