We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.

About UV coordinates

Zhang
Participant

       I would like to ask how to convert UV values between 0-1. I know GetTextureCoordinate can get accurate uv coordinates, but I think the value should be used in Archicad. I now need to render my Archicad model somewhere else. So I'm wondering how to convert texture coordinates to more generic values between 0-1. If anyone knows the method, please let me know, it's important to me, thank you very much

2 REPLIES 2
Dayiz
Booster

I haven't worked with UV and GetTextureCoordinate yet, but shouldn't it be possible to just divide the value of your coordinates by the biggest number?

Example: You have a max Coord (5 | 10). So you divide every x value by 5 and y value by 10.

Your max would end up at (1 | 1) and all other coordinates would have values between 0 and 1.

This doesn't work if you have negative Coords, but you can eliminate them by shifting all coords, so that your most negative coord is at (0 | 0).

But since I havn't used any of this in Archicad, im not sure if it works in the way you want it.

kovacsv
Booster

Don't do that. A texture coordinate bigger than 1.0 is completely valid in all applications. It only means that the texture must be repeated more than once along the relevant axis.