POV-Ray : Newsgroups : povray.windows : MUST, be very simple: Win bmp as texture on objects Server Time: 28 Sep 2020 22:52:38 GMT
  MUST, be very simple: Win bmp as texture on objects (Message 12 to 21 of 21)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Kenneth
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 2 Jan 2011 02:25:01
Message: <web.4d1fdd725827f18f196b08580@news.povray.org>
"syntotic" <nomail@nomail> wrote:
>... But I need and want the image to be manipulable as the face of a box or
> the background of a plane.
>
> What I got so far was... a background plane that shows the picture distorted as
> if the plane was hyperbolic space!...Tried scaling
> different ways but pixels are still stretched into elongated, eliptical
> cuadrangles.

From your description, it seems that the image and the plane are not aligned to
each other (?)

In any case, here's a simple workable example:
camera {
  location  <0, 0, 0>
  look_at   <0, 0, 300> // or just use look_at z
  right     x*image_width/image_height  // aspect
  angle 67

plane{z,300 // a vertical 'wall' 300 units into the far distance
     texture{
          pigment{
            image_map{sys "your_image.bmp" interpolate 2} // vertical by default
            translate <-.5,-.5,0> // optional, just to shift the 1 X 1
                                  // default-size image so that camera at
                                  // <0,0,0> can see *all* of it after the
                                  // scaling below
            scale 300 // or whatever will show the *full* image to the camera
                 }
          finish{ambient 1 diffuse 0}
            }
    }

Note that I left out the "once" keyword in the image map--that's to make sure
you see *something* on the plane (the image will be tiled infinitely in x and
y.)

But also note that this example assumes that your original image_map is a SQUARE
one; if it's not square, then the scaling needs to be changed to squash or
stretch your image in x, to get it to look correct. One easy way to do that is
to find the actual pixel dimension of your image--let's say it's 1000 pixels
wide by 500 pixels high--then do this instead: scale 300*<1000,500,1>/500  The
z-scaling isn't important here.

Hope this helps.

Ken


Post a reply to this message

From: syntotic
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 2 Jan 2011 18:25:01
Message: <web.4d20c0d55827f18fb4cddd650@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> camera {
>  location  <0, 0, 0>
>  look_at   <0, 0, 300> // or just use look_at z
> }
>
> plane{z,300 // a vertical 'wall' 300 units into the far distance
>      texture{
>           pigment{
>             image_map{sys "your_image.bmp" interpolate 2} // vertical by default
>             translate <-.5,-.5,0> // optional, just to shift the 1 X 1
>                                   // default-size image so that camera at
>                                   // <0,0,0> can see *all* of it after the
>                                   // scaling below
>             scale 300 // or whatever will show the *full* image to the camera
>                  }
>           finish{ambient 1 diffuse 0}
>             }
>     }

Like magic, right? It produces an amplification from the original picture
without apparent loss of quality. Needs more tweaking to show it up as in a
simple visor, same picture size. Seems it was the interpolate 2 indication what
was missing.


Post a reply to this message

From: Alain
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 2 Jan 2011 22:52:25
Message: <4d2101a9$1@news.povray.org>
Le 2011-01-02 13:24, syntotic a écrit :

> Like magic, right? It produces an amplification from the original picture
> without apparent loss of quality. Needs more tweaking to show it up as in a
> simple visor, same picture size. Seems it was the interpolate 2 indication what
> was missing.
>
>

What interpolate does is to smoot out the pixels. Usefull when you use a 
relatively small image and you scale it larger than it's original 
dimentions.



Alain


Post a reply to this message

From: syntotic
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 2 Jan 2011 23:20:00
Message: <web.4d2106fd5827f18fb51759700@news.povray.org>
So! For a bmp image 595x345,
placed as a pigment image_map, interpolation 2, once,
translated [-.5,-.5,0] and _scaled_ 1330*<595,345,1>/345,
on a plane {z,2300}
seen through a camera at [0,0,0] looking_at [0,0,2300],
the original image displays well at size 597x345
with top corner located at 101,127
on a render size image of 800x600.

You get the idea... Height was adjusted, but width does not fit without losing
the vertical adjustment. Translate the image_map [-.6677,-.1367,0]: now it is
aligned to the top corner for a 800x600 render image size, but dims become
598x346. See the magic numbers? The script is brittle though may be enough for
my particular purpose... One pixel error in size does not seem much, but given
all other there possible adjustments... Once upon a time I had an image cropper
utility for these cases to ignore the black background and extract the image
only, (and a digested C++ COM controlled POV RAY version) but not anymore.
There _must_ be a simpler expression to locate a picture in a scene! I suspect
such expression may be quite simple for camera types other than default.


Post a reply to this message

From: clipka
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 3 Jan 2011 02:37:49
Message: <4d21367d$1@news.povray.org>
Am 03.01.2011 00:17, schrieb syntotic:
> So! For a bmp image 595x345,
> placed as a pigment image_map, interpolation 2, once,
> translated [-.5,-.5,0] and _scaled_ 1330*<595,345,1>/345,
> on a plane {z,2300}
> seen through a camera at [0,0,0] looking_at [0,0,2300],
> the original image displays well at size 597x345
> with top corner located at 101,127
> on a render size image of 800x600.
>
> You get the idea... Height was adjusted, but width does not fit without losing
> the vertical adjustment. Translate the image_map [-.6677,-.1367,0]: now it is
> aligned to the top corner for a 800x600 render image size, but dims become
> 598x346. See the magic numbers? The script is brittle though may be enough for
> my particular purpose... One pixel error in size does not seem much, but given
> all other there possible adjustments... Once upon a time I had an image cropper
> utility for these cases to ignore the black background and extract the image
> only, (and a digested C++ COM controlled POV RAY version) but not anymore.
> There _must_ be a simpler expression to locate a picture in a scene! I suspect
> such expression may be quite simple for camera types other than default.

Have you ever had a look at screen.inc? If I understand your problem 
right, that might be what you want.


Post a reply to this message

From: Nekar Xenos
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 5 Jan 2011 19:09:31
Message: <op.vounh1vtufxv4h@xena>
On Sat, 01 Jan 2011 08:08:42 +0200, syntotic <nomail@nomail> wrote:

> Should be the SIMPLEST advanced PovRay task: to wrap a simple Windows  
> BMP image
> astexture. Just specify camera, lights, object... and the texture. Then  
> the
> object is wrapped by a SIMPLE Windows BMP (bit-map file) ad the object  
> becomes
> the bitmap image! Like in, I camera watch a SIMPLE PLANE and the  
> observed face
> IS, the Windows BMP image I provided! No nonsense bmp spotting on a  
> plane. Then
> I can make transformation, change light colors, brake the plane, extend  
> into 3D
> forms, filter colors... but a SIMPLE BMP Windows image. No keyword  
> magic, no 3D
> coords expertise, just WATCH the SIMPLE BMP image on a PLANE from a  
> point of
> view with a camera and lights. Like in a theater stage? No advanced  
> language
> knowledge, no wading in documentation to project a SIMPLE WINDOWS BMP  
> image on a
> plane and use it as background, landscape, primed oil surface,  
> whatever...
> simple newbie secods with no expertise to project a SIMPLE BMP WINDOWS  
> IMAGE as
> surface texture, without going into material maps, color indexes,
> transformations... JUST a SIMPLE WINDOWS BMP BMP IMAGE FILE as texture  
> on a
> watched plane or object. Why not a single word? Landscape. Photographed  
> texture.
> Stage scene. a SIMPLE WINDOWS BMP BMP IMAGE FILE TEXTURE. So... what are  
> the
> instructions to make a SIMPLE WINDOWS BMP BMP IMAGE FILE TEXTURE ON AN  
> OBJECT
> like a plane or a cube?
>
>
The only "1 button solution" I can think of is
Insert\Scene templates\Image Map
and then replace png with bmp and replace the file name.

I'm guessing maybe I misunderstood your question because this sounds too  
easy...
-- 
-Nekar Xenos-

"The spoon is not real"


Post a reply to this message

From: syntotic
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 11 Jan 2011 23:35:00
Message: <web.4d2ce8615827f18fc4a147790@news.povray.org>
"Nekar Xenos" <nek### [at] gmailcom> wrote:
> The only "1 button solution" I can think of is
> Insert\Scene templates\Image Map
> and then replace png with bmp and replace the file name.

Yes, more or less... Went through some quick panic when erased an image_map and
it was no longer working... but an insertion set things straight. What I mean is
that displaying an image within a scene should be so standard that there should
be a very DIRECT way to do it, something like object {image {sys name... <x, y,
z>} scale...} It is that you have to manipulate an object as if it was the
texture because it is the texture that carries the image (meaning) so like I
posted before you end up matching coordinates for texture and object. In Windows
terms what is missing is similar to the brush to DC aligning. Should be that
simple at least.


Post a reply to this message

From: clipka
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 12 Jan 2011 01:16:20
Message: <4d2d00e4$1@news.povray.org>
Am 12.01.2011 00:31, schrieb syntotic:

> that displaying an image within a scene should be so standard that there should
> be a very DIRECT way to do it, something like object {image {sys name...<x, y,
> z>} scale...} It is that you have to manipulate an object as if it was the
> texture because it is the texture that carries the image (meaning) so like I
> posted before you end up matching coordinates for texture and object. In Windows
> terms what is missing is similar to the brush to DC aligning. Should be that
> simple at least.

Actually it is not /that/ common that it would warrant adding hard-wired 
syntactical sugar for it into the POV-Ray parser.

If you frequently use such constructs, I suggest writing a macro.


Post a reply to this message

From: syntotic
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 13 Jan 2011 07:35:00
Message: <web.4d2eaa1c5827f18f631654b30@news.povray.org>
> If you frequently use such constructs, I suggest writing a macro.

No, I think one of the in-house mathematicians should work the formulae to
handle images as textures and post them in the documentation.

Making tests now I can understand the faded border in some pictures I remember
seeing from time to time to be the added pixel columns when the image is
distorted only a few lines beyond its normal dimensions. It does not show up
with a single pixel column added, but when it is ten or more it is noticeable.

Basically we need a f(w,h|camera<...>) to be translated into texture {translate
<...>} and object {transform <...>} so that the resulting image be at x,y with
width and height w,h. I think it needs somebody very conversant with
scene/camera assumptions and coordinate systems to convert the whole issue into
pixels.


Post a reply to this message

From: clipka
Subject: Re: MUST, be very simple: Win bmp as texture on objects
Date: 13 Jan 2011 12:27:36
Message: <4d2eefb8$1@news.povray.org>
Am 13.01.2011 08:30, schrieb syntotic:
>> If you frequently use such constructs, I suggest writing a macro.
>
> No, I think one of the in-house mathematicians should work the formulae to
> handle images as textures and post them in the documentation.

FYI: The dev team is grateful for any feedback and suggestions, but at 
the end of the day /they/ decide what they implement, document, etc.

I think I have made it clear enough that what you're asking for (or, to 
be more precise: what I /think/ you're asking for) is not going to happen.

'Nuff said.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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