Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add textures to imported obj file #151

Open
blenzig opened this issue Sep 6, 2022 · 2 comments
Open

Add textures to imported obj file #151

blenzig opened this issue Sep 6, 2022 · 2 comments

Comments

@blenzig
Copy link

blenzig commented Sep 6, 2022

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
Copy link
Author

blenzig commented Sep 6, 2022

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
Copy link
Author

blenzig commented Sep 6, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant