POV-Ray : Newsgroups : povray.windows : New Povray User... : Re: New Povray User... Server Time
28 Jul 2024 16:21:24 EDT (-0400)
  Re: New Povray User...  
From: Jerry Anning
Date: 20 Jul 1998 17:47:07
Message: <35B3ACCE.D5BE9606@dhol.com>
Grey wrote:

> I'm trying my hand at POVRAY by exporting objects from RHINO.
> 
> My very first issue is how to inlcude Texture Maps.  Can they be In JPG
> format or do they need to be in another format?
> 
> I'm having difficulty understanding the Dialog on how they need to be
> assigned.
> 
> I added the texture map to the following:
> 
> #declare Object1Texture = texture {
>    pigment { color rgb <1, 1, 1> }
>    finish  { ambient 1 diffuse 1 }
> }
> 
> By adding it thus:
> 
> #declare Object1Texture = texture {
>    pigment { color rgb <1, 1, 1> }
>    finish  { ambient 1 diffuse 1 }
>    texutre { texture001.jpg }
> }

What you are trying to do is called an image map in POV.  They are
declared as part of the pigment.  .jpg isn't suitable for POV, but .tga,
.png and.gif will work.  A trick about image maps is that POV assumes
that they are being projected along the positive z axis (into the
screen).  They also are projected to a unit square from <0, 0, 0> to <1,
1, 0>.  Therefore, you may need to scale, rotate and/or translate the
image map to the place and orientation you desire.  If the object is too
large, a (planar) image map will tile unless you use the once option. 
Here is the proper syntax for a simple image map texture based on what
you attempted.  For more details, consult the documentation.  *Note* If
you are using the 3.1 beta, you will want to download the 3.02 docs,
since they are much better organized at the moment.

#declare Object1texture =
texture
  {
    pigment { image_map { tga "Myimage.tga" } }
    finish { ambient 1 diffuse 1 } // This is a very odd setting!
    // Are you sure that is what you want?
  }

Then you use the texture as, say:

box { <0, 0, 0>, <1, 1, 1> // or whatever object
  texture { Object1texture }
  }

The indentation is optional.  That is just how I do it.
Good luck

Jerry Anning
cle### [at] dholcom


Post a reply to this message

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