last day (14 days later) » 

11:17 AM
0
A: three.js - model after being mirrored (flipped) doesn't render appropriately

Falk ThieleI dont know how you "mirrored" it, but your faces are now also flipped. Looking closely you can see its not just the doorknob, its everywhere on the model. You can change this in the material with material.side = THREE.BackSide; or THREE.DoubleSide. Another solutions is to mirror your model ...

 
I didn't 'flipped' ( ;) ) them in three.js - I did that in blender using mirror function. Also, even if I mirror those doors first and apply texture after problem still exists.
 
What happens when you change the material side to DoubleSide?
 
I don't use material nowhere - i import texture as *.mtl and don' t assign it to model nowhere in my code.
 
When loading a model, the loader generates materials out of your mtl file. See stackoverflow.com/a/31642463/4977165
 
I see. So if i don't add any code about how texture should be applied to the model it is done somehow by default and I don' t have full control on it. And if I have more complex model I need to add that code, that will tell how to apply texture (just like in my example). Am I right?
 
11:17 AM
The material is assigned to the object by the loader automatically, but you can access it at any time. If you dont want to alter the material, you could try other tricks- I will update my answer.
 
Thank you a lot. I am simply following this example: threejs.org/examples/webgl_loader_obj_mtl.html and I didn' t find there anything with changing material, so I thought it isn' t needed.
hi
 
hi
you can flip in threejs if you dont have to do it in blender
i guess this is the simplest solution
i updated it in my answer, its just setting a negative scale
it depends on your use case, but you can also flip the geometry by assigning an inverse matrix to it. its just about what you want to do next with your model
 
well, that would be good. But let' s say that i will need to add more models to my program. Shall I need to do that with every model i upload? I guess there isn' t any method to check if my textures look good or not
anyway, I'll try your suggestions
 
um
the problem arises from blender or the blender exporter, not threejs
 
Aaaaaa
that explains a lot
:D
 
11:25 AM
when you dont mirror your model in blender, your textures always looks good
 
so just mirror in threejs
 
okay i'll do that
thank you
may I write to you again if I'll have any problems?
 
just open another question and i will answer it if i can :)
 
okay, thank you once again :)
 
11:27 AM
this is flipping with negative scale, it works well. see you
 
bb
except for the fact that it isn' t too flexible solution, changing scale to (-1, 1, 1) worked perfectly. Thanks!
 

last day (14 days later) »