Hello,
I’m currently working on importing sketchup model directly.
I’m using the SDK sample’s skp_to_xml as my reference. In the function CXmlExporter::WriteFace, I am using the output of SUMeshHelperGetSTQCoords and SUUVHelperGetUVQ to populate our uv buffer.
-
In some cases, the models are texture correctly when directly using the uv values, in others it is very tiled.
-
In case of the tiled textures if use the s_scale & t_scale returned from SUTextureGetDimensions i.e. info.info.texture_sscale_ & info.texture_tscale_ like something below,
float fFrontFaceTexCoordU = (float)info.vertices_[dwVert].front_texture_coord_.x() * texture_sscale_;
float fFrontFaceTexCoordV = -(float)info.vertices_[dwVert].front_texture_coord_.y() * texture_tscale_;the tiled texture looks correct.
I wasn’t clear on what is the correct way of getting the final UVs?
Ian