THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 29/08/2009 at 15:20, xxxxxxxx wrote:
Cinema 4D Version: R10-R11
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
I'm having a bit of difficulty here. In my plugin, a planar shape with UVs is being extruded with SendModelingCommand() set to create a cap. The cap UVs are added but they are all simply 0-1,0-1 squares over the UV plane. Since the cap 'mirrors' the original polygons that are now the top of the extruction, I want to use the top UVs to set the bottom cap UVs - there isn't much of a choice actually, don't you agree?
Not so fast. If I simply copy them from top to bottom, each polygon looks to be individually inverted. If I invert (1.0-uvstruct.a.x, etc.) the x value of the UV points it gets worse. So, how would I 'mirror' the top UVs so as to get proper bottom cap UVs?
I'm completely stuck on how to map this bottom cap from the top polygons.
On 29/08/2009 at 17:47, xxxxxxxx wrote:
Well, it ended being the use of the object's vertices to get this working.
Addendum: How do you scale/translate the UV mapping to fit within the unit-square UV space easily? For objects without UVWTags I am generating UVs (GenerateUV()) using a Cubic mapping since the objects are planar on the X-Z plane (Flat doesn't work here!). The problem is that the mapping results aren't restricted to the UV space (0-1, u and v). Subsequent mappings of the extrusion and beveling are, which results in two sizes of UV mapping. Not pretty.
On 29/08/2009 at 20:28, xxxxxxxx wrote:
Now you pissed me off. I'm sitting here expecting my fit to unit-square to work flawlessly (like the flawless code that I wrote to do it) and I find that you can't keep your damn UV settings straight when triangles are involved. In one case you set the UVWStruct uvs.d to Vector(0.0f) and in others, you set it to the same as uvs.c (which would be gracious, thank you). Waving my hands, I had nothing to do with these UV settings. This was completely the result of the texture tag with Cubic mapping and a call to GenerateUV(). Period. So I had zero to do with the results that I'm dealing with.
How am I supposed to deal with UVW complexities if I can't have any guarantees on the values being reasonable (0,0,0 when it should never be isn't!). It seems reasonable that the UVWStruct values for .d should always be exactly .c when the polygon is a triangle. Or you should mention that you have to get the polygon array and check every polygon for (c == d).
Bellevue, here I come...