POV-Ray : Newsgroups : povray.newusers : bitmap to polygons? : Re: bitmap to polygons? Server Time
28 Sep 2024 07:36:44 EDT (-0400)
  Re: bitmap to polygons?  
From: Alain
Date: 8 Apr 2012 13:21:52
Message: <4f81c930@news.povray.org>

> I think I understand a little of the image map thing used to provide textures
> for surfaces, and why a bitmap becomes a square polygon (0,0) to (1,1).  What I
> want is to bring a bitmap in as a "billboard" more or less, with its aspect
> ratio retained (and I guess, assuming square pixels in the original.  To be able
> to do that, it seems I would need to read the bitmap and have each area of color
> become a polygon filled with that color - I think.

You can evaluate a pigment at a given location.
Use eval_pigment(x, y, z) for that.
It will NOT create any polygon, it will only return an rgb vector.

You can use a gray scale version of your image to generate a hight_field 
and use the original image to give it a colour. You'll need to rotate 


>
> 1) If I load the bitmapped image as an image map and stretch it to match its
> original aspect ratio (for example, if it was 320 x 240) will it look like it
> originally did and therefore I can ignore the problem?  (when I last tried this
> about 3 years ago, I knew the SDL statements to do this, but I've forgotten
> them).

Use the scale transformation. scale<320, 240, 1> will make your image 
320 by 240 units large. It will always stretch to infinity along the z axis.

>
> 2) if not, then are there any utilities or graphics programs out there which
> will create POV-Ray polygons from bitmapped images?

For that, you can use a height_field that will translate the image into 
a ground like object. It's made to work with a gray scale image, but you 
can use a colour image if you are ready to get some unexpected results.


>
> 3) Am I even barking up the right tree?

Wouf!

>
>

Alain


Post a reply to this message

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