License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…

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

Why is the UV obtained through ACAPI_ModelAccess_GetTextureCoord API different from ArchiCAD?

sxs
Booster

Hi,everyone:

 

 In ArchiCad:

sxs_0-1749782033610.png

In my Render System:

sxs_1-1749782075088.png

 

It is obvious that the size of the texture is inconsistent(Ignore color).

I'm pretty sure the exported texture file is fine, so I think it's a UV issue.

 

					//texture
					API_TexCoordPars	pars = { 0 };
					pars.elemIdx = elemIdx;
					pars.bodyIdx = bodyIdx;
					pars.pgonIndex = j;
					//
					pars.surfacePoint.x = backCo.x;
					pars.surfacePoint.y = backCo.y;
					pars.surfacePoint.z = backCo.z;
					err = ACAPI_ModelAccess_GetTextureCoord(&pars, &resultUV);
					if (err == NoError)
						uv.push_back({ resultUV.u, resultUV.v });

 

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
sxs
Booster

sxs_0-1750057506369.png

 

if (err == NoError)
						uv.push_back({ resultUV.u / xSize, resultUV.v / ySize });

It seems that the following actions need to be taken.But the xSize/ySize I get can not produce the correct effect.

View solution in original post

2 REPLIES 2
Solution
sxs
Booster

sxs_0-1750057506369.png

 

if (err == NoError)
						uv.push_back({ resultUV.u / xSize, resultUV.v / ySize });

It seems that the following actions need to be taken.But the xSize/ySize I get can not produce the correct effect.


@sxs wrote:
if (err == NoError)
						uv.push_back({ resultUV.u / xSize, resultUV.v / ySize });

It can work.

 


@sxs wrote:

It seems that the following actions need to be taken.But the xSize/ySize I get can not produce the correct effect.


The reason is that the texture is missing.