POV-Ray : Newsgroups : povray.newusers : Assigning different textures to triangles in a mesh Server Time
4 Sep 2024 16:16:13 EDT (-0400)
  Assigning different textures to triangles in a mesh (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Mark M  Wilson
Subject: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 22:39:12
Message: <pan.2002.09.08.22.41.46.519914.1820@att.net>
Er, I thought you were supposed to be able to have different triangles in
a mesh have different pigments or textures, but I'm getting seemingly
contradictory error messages when I render.

I have a mesh that I want to use for some panes in a "stained glass"
window, and I want the triangles to be of different glass textures from
the glass.inc file.  

I'm specifically trying to use the Col_Glass_Winebottle on individual
triangles, like so:

#declare leaf_window =
mesh {
	triangle {<a>, <b>, <c> texture { Col_Glass_Winebottle}}
	triangle {<c>, <d>, <e> texture { Col_Glass_Orange }}
	etc...
}
but it chokes on the first one, saying
-- Parse Error: Expected 'texture identifier', colour identifier found instead

so if I change the above to say "pigment { Col_Glass_Winebottle}}", it
says:
Parse Error: No matching } in 'triangle', pigment found instead


So which is it, a texture or a pigment ?  WTF?!?
The docs use a texture statement within individual triangles, so I know
I'm supposed to be able to treat each one separately.  What obvious thing
am I missing?
Thanks for any help!
Mark W.


-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GLS$ d+ s+: a C+ UL--- P L++ E--- W+ N+ o+ K- w-- 
O-- M- V-- PS+ PE Y+ PGP- t 5-- X- R- tv+ b+ DI++ D++ 
G e+++ h--- r+++ y+++ 
------END GEEK CODE BLOCK------


Post a reply to this message

From: Ken
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 22:49:31
Message: <3D7C0D20.227600D8@pacbell.net>
"Mark M. Wilson" wrote:
> 
> Er, I thought you were supposed to be able to have different triangles in
> a mesh have different pigments or textures, but I'm getting seemingly
> contradictory error messages when I render.
> 
> I have a mesh that I want to use for some panes in a "stained glass"
> window, and I want the triangles to be of different glass textures from
> the glass.inc file.
> 
> I'm specifically trying to use the Col_Glass_Winebottle on individual
> triangles, like so:
> 
> #declare leaf_window =
> mesh {
>         triangle {<a>, <b>, <c> texture { Col_Glass_Winebottle}}
>         triangle {<c>, <d>, <e> texture { Col_Glass_Orange }}
>         etc...
> }
> but it chokes on the first one, saying
> -- Parse Error: Expected 'texture identifier', colour identifier found instead
> 
> so if I change the above to say "pigment { Col_Glass_Winebottle}}", it
> says:
> Parse Error: No matching } in 'triangle', pigment found instead
> 
> So which is it, a texture or a pigment ?  WTF?!?
> The docs use a texture statement within individual triangles, so I know
> I'm supposed to be able to treat each one separately.  What obvious thing
> am I missing?
> Thanks for any help!
> Mark W.

You're trying to use color definitions as a texture identifier. Triangles
in a mesh will only take a texture. To use the pre-declare colors listed
in glass.inc you would have to use them like this -

#include "glass.inc"

mesh {
        triangle {<a>, <b>, <c> texture { pigment { Col_Glass_Winebottle }}}
        triangle {<c>, <d>, <e> texture { pigment { Col_Glass_Orange }}}
        etc...
}

-- 
Ken Tyler


Post a reply to this message

From: Mark M  Wilson
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 22:59:38
Message: <pan.2002.09.08.23.02.07.170460.1820@att.net>
On Sun, 08 Sep 2002 22:53:20 -0400, Ken wrote:


Oh.  Well, I had tried to do a "test run" on a square (mesh of 2
triangles) but I had assigned only one texture to the whole mesh,
like so:
mesh {
	triangle {1}
	triangle {2}
	texture { Col_Glass_Winebottle}
}

and it worked like that!  Why does it let me use a color identifier as a
texture for the whole mesh, but not for the ind. triangles?  That doesn't
really make sense to me.  The docs could have been a little clearer on
that point, if you ask me....
Thanks -- you've saved me >some< head-banging.  ;-)
--Mark W.

> 
> You're trying to use color definitions as a texture identifier.
> Triangles in a mesh will only take a texture. To use the pre-declare
> colors listed in glass.inc you would have to use them like this -
> 
> #include "glass.inc"
> 
> mesh {
>         triangle {<a>, <b>, <c> texture { pigment { Col_Glass_Winebottle
>         }}} triangle {<c>, <d>, <e> texture { pigment { Col_Glass_Orange
>         }}} etc...
> }
> 

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GLS$ d+ s+: a C+ UL--- P L++ E--- W+ N+ o+ K- w-- 
O-- M- V-- PS+ PE Y+ PGP- t 5-- X- R- tv+ b+ DI++ D++ 
G e+++ h--- r+++ y+++ 
------END GEEK CODE BLOCK------


Post a reply to this message

From: Mark M  Wilson
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 23:08:20
Message: <pan.2002.09.08.23.10.52.801120.1820@att.net>
Er, never mind what I said about the docs being unclear.  I just read
again the part where it says "Textures cannot be specified inside the
mesh due to thepoor memory performance that would result."
I notice it says "CANNOT", not SHOULD NOT!  They really mean it!
I'll go sit quietly in my corner now...
Thanks,
Mark

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GLS$ d+ s+: a C+ UL--- P L++ E--- W+ N+ o+ K- w-- 
O-- M- V-- PS+ PE Y+ PGP- t 5-- X- R- tv+ b+ DI++ D++ 
G e+++ h--- r+++ y+++ 
------END GEEK CODE BLOCK------


Post a reply to this message

From: Ken
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 23:14:16
Message: <3D7C12EF.C299AA25@pacbell.net>
"Mark M. Wilson" wrote:
> 
> Er, never mind what I said about the docs being unclear.  I just read
> again the part where it says "Textures cannot be specified inside the
> mesh due to thepoor memory performance that would result."
> I notice it says "CANNOT", not SHOULD NOT!  They really mean it!
> I'll go sit quietly in my corner now...

Unless you have a great need to use a mesh object you can get greater
flexibility by just using a union of triangles instead of a mesh.

-- 
Ken Tyler


Post a reply to this message

From: Mark M  Wilson
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 23:18:04
Message: <pan.2002.09.08.23.20.36.111164.1883@att.net>
On Sun, 08 Sep 2002 22:53:20 -0400, Ken wrote:

 To use the pre-declare
> colors listed in glass.inc you would have to use them like this -
> 
> #include "glass.inc"
> 
> mesh {
>         triangle {<a>, <b>, <c> texture { pigment { Col_Glass_Winebottle
>         }}} triangle {<c>, <d>, <e> texture { pigment { Col_Glass_Orange
>         }}} etc...
> }

Ok, I tried this, and it didn't work either.   AAARRGGH!  I _really_
don't relish the idea of making extremely thin triangle-shaped prisms,
and rotating/translating them into place...
--Mark W.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GLS$ d+ s+: a C+ UL--- P L++ E--- W+ N+ o+ K- w-- 
O-- M- V-- PS+ PE Y+ PGP- t 5-- X- R- tv+ b+ DI++ D++ 
G e+++ h--- r+++ y+++ 
------END GEEK CODE BLOCK------


Post a reply to this message

From: Mark M  Wilson
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 23:22:13
Message: <pan.2002.09.08.23.24.45.457286.1883@att.net>
On Sun, 08 Sep 2002 23:18:07 -0400, Ken wrote:

> 
> Unless you have a great need to use a mesh object you can get greater
> flexibility by just using a union of triangles instead of a mesh.
> 

I didn't know that triangles could be used outside the context of a
mesh....  That's why I'm posting to the newusers group!  ;-)
Thanks again!
--Mark  W.
-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GLS$ d+ s+: a C+ UL--- P L++ E--- W+ N+ o+ K- w-- 
O-- M- V-- PS+ PE Y+ PGP- t 5-- X- R- tv+ b+ DI++ D++ 
G e+++ h--- r+++ y+++ 
------END GEEK CODE BLOCK------


Post a reply to this message

From: Ken
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 23:23:35
Message: <3D7C151D.F109E717@pacbell.net>
"Mark M. Wilson" wrote:

> Ok, I tried this, and it didn't work either.   AAARRGGH!  I _really_
> don't relish the idea of making extremely thin triangle-shaped prisms,
> and rotating/translating them into place...

What it really want's is -

#include "glass.inc"

#declare T1 = texture { pigment { Col_Glass_Winebottle }}
#declare T2 = texture { pigment { Col_Glass_Orange }}


mesh {
        triangle {<a>, <b>, <c> texture { T1 }}
        triangle {<c>, <d>, <e> texture { T2 }}
        etc...
}


-- 
Ken Tyler


Post a reply to this message

From: Mark M  Wilson
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 23:25:28
Message: <pan.2002.09.08.23.27.55.718565.1883@att.net>
On Sun, 08 Sep 2002 23:27:25 -0400, Ken wrote:

But you're saying, if I understand correctly, that with a union of
triangles, I can use a pigment OR a texture quite freely, yes?
--Mark



> What it really want's is -
> 
> #include "glass.inc"
> 
> #declare T1 = texture { pigment { Col_Glass_Winebottle }} #declare T2 =
> texture { pigment { Col_Glass_Orange }}
> 
> 
> mesh {
>         triangle {<a>, <b>, <c> texture { T1 }} triangle {<c>, <d>, <e>
>         texture { T2 }} etc...
> }
> 
> 

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GLS$ d+ s+: a C+ UL--- P L++ E--- W+ N+ o+ K- w-- 
O-- M- V-- PS+ PE Y+ PGP- t 5-- X- R- tv+ b+ DI++ D++ 
G e+++ h--- r+++ y+++ 
------END GEEK CODE BLOCK------


Post a reply to this message

From: Ken
Subject: Re: Assigning different textures to triangles in a mesh
Date: 8 Sep 2002 23:27:10
Message: <3D7C15F4.2B7F42B4@pacbell.net>
"Mark M. Wilson" wrote:

> I didn't know that triangles could be used outside the context of a
> mesh....  That's why I'm posting to the newusers group!  ;-)

In POV-Ray v1.0 and v2.2 all triangle based objects where contained in a union.
Meshes didn't appear until POV-Ray v3.0 and the restrictions that came with them.
The real beauty of meshes are the reduced memory requirements when copies of
declared mesh objects are used. There is no real difference otherwise.

-- 
Ken Tyler


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.