Reverse face and uv
-
Hello.
I'm creating a sketchup importer in c++ and opengl.
I have a problem with th UV mapping.
I see that in sketchup the uvs can be positive or negative , and if i reverse a face the UV changes , but is not only inverted the sign , whats changes and how i can import it in opengl system UV. -
I don't have really clear what are the difference between faces and reversed faces, so in my importer i use an atlas and I calculate the new uv with an
newU = abs(U) * scaleMatrixU + offsetU;
newV = abs(V) * scaleMatrixV + offsetV;and this in non reversed face seems correct , the problem is when i have a reverse face , the texture UV are wrong .
if i don't use the abs the UV are wrong at all both in reversed that in non reversed faces.
But what mean a negative U or a negative V in sketchup?
is a form of tile or wrap?
I not understandthanks.
-
This really is a very basic concept about face orientation...
Most exported and 3rd party renderers assume that the part of the face you want to render is the front of that face, with its applied mamterial [if any].
IF you have a sloppily made model where some faces are the wrong way round - so the back of the face is visible [when most sane people would expect to see the front face] - then it might well look OK in the SKP - Sketchup is quite forgiving... BUT most 3rd party tools will ignore that face's back material completely and simply give it a default material like all of the other back faces which are [usually] unseen [often white/black depending on the app]... and then render the face's front with whatever material it might have [which is then 'unseen'!!!]You need to give your SKP and other app's a chance and model appropriately - not sloppily!!!
You should never need to consider a face's back_material IF your model has been made properly. If you have a thin object - like a glazed-window-pane - then it should have two skins [faces], each of which should face out so you never have to see or consider the 'back_material'...
Advertisement