POV-Ray : Newsgroups : povray.windows : interior texture for triangles Server Time
22 Dec 2024 17:12:43 EST (-0500)
  interior texture for triangles (Message 1 to 4 of 4)  
From: tune
Subject: interior texture for triangles
Date: 21 Feb 2006 12:00:01
Message: <web.43fb46267124289f858311eb0@news.povray.org>
From a regular mesh of a real orography, I produced a mesh of many
triangles. Then I want to use Pov Ray for rendering the scene.
It seemed to be an easy job, but I encountered a problem just during my
first few hours in Pov Ray - programming. In fact, I'm wondering how I can
fill in triangles with a texture. If I just use "texture", it applies only
to the borders of triangles, so that the whole mesh is almost black. If I
try to use "interior_texture", an error reminds me that, as the guide says,
it cannot apply to triangles.
Can anybody help me?


Post a reply to this message

From: Bob Hughes
Subject: Re: interior texture for triangles
Date: 21 Feb 2006 16:21:11
Message: <43fb8447$1@news.povray.org>
"tune" <nomail@nomail> wrote in message 
news:web.43fb46267124289f858311eb0@news.povray.org...
> From a regular mesh of a real orography, I produced a mesh of many
> triangles. Then I want to use Pov Ray for rendering the scene.
> It seemed to be an easy job, but I encountered a problem just during my
> first few hours in Pov Ray - programming. In fact, I'm wondering how I can
> fill in triangles with a texture. If I just use "texture", it applies only
> to the borders of triangles, so that the whole mesh is almost black. If I
> try to use "interior_texture", an error reminds me that, as the guide 
> says,
> it cannot apply to triangles.

I'm not good with triangle meshes. However, I think you might be mistaking 
what interior_texture is for. It applies a texture to the inside of an 
object, as opposed to the outside, like the inner view from the center of a 
sphere looking outward. Inside can be a different texture from the outside 
by using interior_texture in conjunction with the usual texture statement. 
It won't fill in triangles, as you found.

All I know about texturing triangles is that they either must be enclosed in 
a mesh and then textured together as a whole, or individually in a special 
way. I think the Help section 3.4.2.3 Mesh will have the answer.

I'm replying as a follow-up to move this into the povray.general group since 
this povray.windows group is all about the operating system interplay with 
POV instead of its scene description language (SDL).

Bob H


Post a reply to this message

From: tune
Subject: Re: interior texture for triangles
Date: 24 Feb 2006 10:40:00
Message: <web.43ff24bc659ce108858311eb0@news.povray.org>
"Bob Hughes" <omniverse@charter%net> wrote:
> "tune" <nomail@nomail> wrote in message
> news:web.43fb46267124289f858311eb0@news.povray.org...

> All I know about texturing triangles is that they either must be enclosed in
> a mesh and then textured together as a whole, or individually in a special
> way.

I did not tell you all about my .pov file (that you can find below in this
post). Actually, all triangles where eclosed in a mesh. Texture does not
work, both inside "triangle" and outside it, inside "mesh".
What do you mean when you say "or individually in a special way"? Maybe 2D
objects can be filled in with colours otherwise than by "textures"? This
wuold be the crucial point.

> I think the Help section 3.4.2.3 Mesh will have the answer.

Thank you Bob. I already read this section of Help: it was my starting
point.
Problems actually came after this point.

> I'm replying as a follow-up to move this into the povray.general group since
> this povray.windows group is all about the operating system interplay with
> POV instead of its scene description language (SDL).

Sorry, but there are so many groups..... I did not spend a few seconds in
choosing the right one.
But I do not actually find my post in povray.general group nowadays. So,
please excuse me if I post here again.

Here is part of my .pov file:

#version 3.0
#include "colors.inc"
#include "shapes.inc"
#include "transforms.inc"

global_settings { assumed_gamma 2.2 }
// panoramic lens for wide field of view with less distortion
camera {
//  orthographic
  panoramic
  location <-6, -6, 32>                  // position
  look_at  <32, 32, 0>                  // view
 // right    x*image_width/image_height  // aspect
  angle    30                            // field (greater than 180 degrees
possible)
}


background { color rgb < 0,0.5,0.7 > }

#declare Material_0001 = texture {
//  pigment { color rgb < 1,0.25,0.25 >
  pigment { color White
  }
//  finish { ambient 0.2 diffuse 0.5 }
}

mesh {
 triangle {
 <  0.,  23.0799999,  0.>, <  0.,  1.,  1.>, <  1.,  22.7399998,  1.>
// here I wrote "texture { Material_0001 }" in a first trial
 }
 triangle {
 <  0.,  26.6399994,  1.>, <  0.,  2.,  2.>, <  1.,  22.9400005,  2.>
// here I wrote "texture { Material_0001 }" in a first trial
 }
...........
// here I wrote "texture { Material_0001 }" in a second trial, erasing it
from above
}


Post a reply to this message

From: Mike Williams
Subject: Re: interior texture for triangles
Date: 24 Feb 2006 13:37:13
Message: <LCOB$KA7I1$DFwf1@econym.demon.co.uk>
Wasn't it tune who wrote:
>
>I did not tell you all about my .pov file (that you can find below in this
>post). Actually, all triangles where eclosed in a mesh. Texture does not
>work, both inside "triangle" and outside it, inside "mesh".
>What do you mean when you say "or individually in a special way"? Maybe 2D
>objects can be filled in with colours otherwise than by "textures"? This
>wuold be the crucial point.

Putting the texture statement in either of those positions works. Here's
a version with the camera and light source moved around a bit so that
you can see the colours better.

I've applied Material_0002 to the whole mesh, so any triangle that
doesn't have its own texture becomes red, and I've applied Material_0001
to the first triangle, so it is white.

#include "colors.inc"

global_settings { assumed_gamma 2.2 }

camera {
  location <50, 22, 0>
  look_at  <0, 22, 0>
  angle    20
}

background { color rgb < 0,0.5,0.7 > }

#declare Material_0001 = texture {
  pigment { color White  }
}

#declare Material_0002 = texture {
  pigment { color Red  }
}


mesh {
 triangle {
 <  0.,  23.0799999,  0.>, <  0.,  1.,  1.>, <  1.,  22.7399998,  1.>
 texture { Material_0001 }
 }
 triangle {
 <  0.,  26.6399994,  1.>, <  0.,  2.,  2.>, <  1.,  22.9400005,  2.>
 }

 texture { Material_0002 }
}


light_source {<50, 23, 0> color rgb 2}


Post a reply to this message

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