GDL
About building parametric objects with GDL.
SOLVED!

Object always appears white in Elevationview but not in 3D

Martin Walter
Enthusiast

I create a window from polygons using texture. In 3D view everything works as expected: the texture shows up.

But in elevationviews the windows are always white:

 

!gdl texture.png

 

I figured out that this is caused by how I create the textures in GDL. I use the texture command like in the example 3 from GDL:

 

DEFINE MATERIAL "Yellow Brick+*" 20,
1, 1, 0, ! surface RGB [0.0 .. 1.0]
0.58, 0.85, 0, 0,
! ambient, diffuse, specular, transparent
! coefficients [0.0 .. 1.0]
0, ! shining [0.0 .. 100.0]
0, ! transparency attenuation [0.0 .. 4.0]
0.878401, 0.513481, 0.412253, ! specular RGB [0.0 .. 1.0]
0, 0, 0, ! emission RGB [0.0 .. 1.0]
0, ! emission attenuation [0.0 .. 65.5]
IND(FILL, "common brick"), 61,
IND(TEXTURE, "Brick") ! Fill index, color index, texture index

 

But I set Fill index=-1 and color index=-1

because I have no idea what the color index is.
I would like to pass the color index of a self created RGB color.

But I did not found a command in GDL like:

DEFINE COLOR "dummyColor" ...

AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Martin Walter
Enthusiast

Thanks a lot.

I solved the problem with the white windows in elavation view by settings the values for surface RGB [0.0 .. 1.0] correctly. They were set to white. Now the color shows up correctly in elevation view.

 

So what does Fill index and color index do?

In what view/situation can I see the difference in setting them or leave them -1?

AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD

View solution in original post

5 REPLIES 5
Jochen Suehlo
Moderator

For color you can use REQUEST ("PEN_OF_RGB", colorRGB, penindex) or "RGB_OF_PEN".

There is no command "color index" or "Define Color". I think "color index" must be better named "pen index of fill"

Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Solution
Martin Walter
Enthusiast

Thanks a lot.

I solved the problem with the white windows in elavation view by settings the values for surface RGB [0.0 .. 1.0] correctly. They were set to white. Now the color shows up correctly in elevation view.

 

So what does Fill index and color index do?

In what view/situation can I see the difference in setting them or leave them -1?

AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD
Barry Kelly
Moderator

Not an answer to your question.

But just curious.

Do you have to define materials (or other attributes) at all?

Can't you just use the attributes in your file?

And if you don't have them, just create them.

 

Use the Attribute Manager to import/export to other files and most importantly your template.

 

Unless you need your objects to be used in other files (that don't have those attributes and you don't want to use Attribute Manager) and you must have those specific attributes, then that is fine, DEFINE away.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

The created window scripts are generated programmatically as a BIM export from another system. So the materials cannot be predefined, have to be created on the fly and the Attribute Manager no is an option.

AC22-27, Windows 11, i7-1355U, 32GB RAM, 2TB SSD

Fill and pen index are an attribute index. There is no value reserved as undefined.

A negative fill index is for fills defined in the script, those are to be used through the IND command.

Fill 0 is an empty fill, GLOB_FILL_INDEX_BACKGROUND is the default background fill, and GLOB_FILL_INDEX_SOLID is the default solid fill.

Pen -1 is opaque and pen 0 is transparent (when used as background pen of a fill).

A positive index is to be used through a parameter, where the user can select the actual fill, and GDL will receive the corresponding index.

Péter Baksa
Software Engineer, Library
Graphisoft SE, Budapest