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

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Changing texture origins in GDL

David Collins
Advocate
I'm stuggling to learn about moving texture origins for specific components in GDL objects. After spending several hours in the delightful company of BASE, VERT, and COOR, I have begun to get a kind of a tenuous handle on the thing.

Here's my question: How can I be sure the base/vert/coor thing is limited to just one element? Do I need to reset the texture origin back to the global origin after I've moved it around? How is that done? Or does GDL somehow understand that the relocated texture origin only applies to the object immediately before the coor statement?
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
11 REPLIES 11
Anonymous
Not applicable
Hi David,

I was about to ask related question when found your post. Basicly I would like to know how to change UV coordinates in GDL objects. For example how to change texture projection in AC 9.0 object called "Rail wired". It seems to be rotated 90 deg. "Align 3D texture" functions doesn't work with GDL objects, so if you or anyone else know how to fix that I would be really grateful. Thanks
Dwight
Newcomer
A cheap fix is to make a material with the texture direction rotated 90 degrees.
Dwight Atkinson
Anonymous
Not applicable
Hi Dwight,

Yes, that is what I do for now but in some objects coordinates are obviously wrong so I thought it will be better to fix that than keep "overriding" it with a texture setting.
Anonymous
Not applicable
tigr wrote:
Hi Dwight,

Yes, that is what I do for now but in some objects coordinates are obviously wrong so I thought it will be better to fix that than keep "overriding" it with a texture setting.
It's true that the "overriding" can only go so far, but the only alternative is in the GDL script. It's not so bad for someone comfortable with GDL. If you want to be particularly cool, add a 3D dynamic hotspot to let the user adjust the fill origin.
David Collins
Advocate
Matthew wrote:
If you want to be particularly cool, add a 3D dynamic hotspot to let the user adjust the fill origin.
Very cool indeed, Matthew!
But can you shed any light on my original question? Does the local texture origin need to be somehow reset back to the global origin, in the same way you have to DEL back from ADD, ROT and MUL statements? Or does ArchiCAD only apply the reset origin to the object immediately before the Vert/Coor statements? In a complex GDL object with scores of individual elements, can I be certain the vert/coor statement isn't going to screw up the texture for a lot of elements I don't want to change?
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
Dwight
Newcomer
If contained in the script, all is reset.
Dwight Atkinson
David Collins
Advocate
Dwight wrote:
If contained in the script, all is reset.
Thanks, Dwight.
I've seen some screwiness somewhere, which is why I was asking.
I'll experiment and report back.
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
David Collins
Advocate
Okay, here's what I've worked out. Let's have a GDL script which gives us a row of five prisms, each with a victorian grille bitmap material.

In the first row there is no Vert/Coor statement in the script. The first prism sits at the origin and shares the same origin and proportion with the original bitmap, so the grille is properly centered. Note the texture on the remaining four still starts at the global origin, so the grille on none of them is correctly centered.

In the second series, just after the script for the third prism, I've placed a vert/coor statement which rotates the texture 45 degrees. Note that prisms one and two are also rotated, while four and five are unaffected. Conclusion: Coor/vert statements change the texture orientation of ALL the elements that precede them in the script.

In the third series, I've added a second Vert/coor statement just before the third prism, which resets the texture back to the global origin with no rotation. The texture of the third prism remains rotated, while the others go back to their original positions.

Conclusion: GDL elements with customized texture locations must be bracketed with Vert/coor statements. The statement *after* the targeted object changes the texture origin and orientation. The statement *before* the target element must reset the texture to its global default.
Grilled Victorains.jpg
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
David Collins
Advocate
Sigh.
I should have "not dumb, just slow" written on all my business cards.
Here's the real answer:
BODY -1 needs to go before the target element script and after the vert/coon statements. This seems to limit the special texture orientation to just the elements between the two BODY statements and can include as many elements as you want. No need to write a second vert/coon statement to reset the texture origin.

All this was made clear by autoscripting an element with a custom texture orientation and then playing with the resulting script. (...And confused by the fact that I've been automatically erasing BODY -1 every time I see it...)
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)