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

GDL texture mapping coordination

Anonymous
Not applicable
If I define a texture in GDL and create a 3D object, i.e a polygon with this material, how can I start the texture from the object's local origin? Whatever I do, the texture starts mapping from the plan's origin, and not the object's.

Including for instance:
TEVE 0, 0, 0, 0, 0 !#1
TEVE 0, 0, 0, 0, 0 !#2
TEVE 0, 0, 0, 0, 0 !#3
TEVE 0, 0, 0, 0, 0 !#4
COOR 256, 1, 2, 3, 4
has absolutely no effect on the texture's mapping.
6 REPLIES 6
Anonymous
Not applicable
Try this:
base
vert 0, 0, 0
vert 1, 0, 0
vert 0, 1, 0
vert 0, 0, 1
coor 2 + 256, -1, -2, -3, -4
body -1
David Collins
Advocate
One thing that's counter-intuitive here is that the VERT/COOR statements must be placed after the object code.

Also remember to place a BODY -1 statement before the object code as a companion to the one at the end of the VERT/COOR statements. This makes sure that the new texture origin applies apply only to the specific object. Of course, several objects can be included between the the BODY -1 statements. A stray BODY -1 anywhere in between the object code and the VERT/COOR statements will cancel the texture change.

Another thing: Apply the origin changes to the VERT/COOR statements, along with the required DEL statements, instead of trying to work out the vert vectors.

Here's what works for me:


MATERIAL brick

BODY -1

PRISM_ 5, 0.10,
0,0,15,
0,1,15,
1,1,15,
1,0,15,
0,0,-1

ROTy 90
ADD 0.30, 1.20, 0.00
base
vert 0, 0, 0
vert 1, 0, 0
vert 0, 1, 0
vert 0, 0, 1
coor 2 + 256, -1, -2, -3, -4
DEL 2

BODY -1
David Collins

Win10 64bit Intel i7 6700 3.40 Ghz, 32 Gb RAM, GeForce RTX 3070
AC 27.0 (4001 INT FULL)
Anonymous
Not applicable
Thank you both for the answer. My script was faulty, and also in the wrong order, before the object. Yes, that's quite counter-intuitive.
Anonymous
Not applicable
Is it possible in GDL (with TEVE and COOR statements) to force texture to follow the direction of the TUBE's object space curve path? Picture shows actually what I want to achive (red arrow) on TUBE object, the right woodgrain direction on my door wood elements.

This is the custom TUBE object on which I want to try to solve the problem.
set material mat

body -1

tube 4, 7, 16+32,
0, 0, 0,
0.1, 0, 0,
0.1, 0.05, 0,
0, 0.05, 0,
0, B, 0, 0,
0, 0, 0, 0,
A, 0, 0, 0,
A, B, 0, 0,
0, B, 0, 0,
0, 0, 0, 0,
A, 0, 0, 0

body -1
thanx
Anonymous
Not applicable
Oddly the tube element doesn't map textures well at all. I ended up using GDL primitives to create my own version of a tube with inbuilt texture mapping.
Erich
Contributor
Interesting idea Andrew, I will have to try it.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K