POV-Ray : Newsgroups : povray.binaries.images : Anamorphic images for mirrored cylinder. Server Time
7 Nov 2024 15:34:54 EST (-0500)
  Anamorphic images for mirrored cylinder. (Message 1 to 5 of 5)  
From: William F Pokorny
Subject: Anamorphic images for mirrored cylinder.
Date: 8 Dec 2015 16:43:48
Message: <56674f14@news.povray.org>
In answer to a question to povray.general yesterday on how to do this in 
POV-Ray I worked up the following code to both create and visualize the 
distorted image from any input image.

//---------------------------------------------------------------------------
// POV-Ray code to render both result and distorted image
// I used png formatted square image. Camera00 renders
// both distorted image and its reflection off cylinder.
// Camera01 renders just the distorted image for the table
// top. Of course, endless variations possible.
//---------------------------------------------------------------------------
#version 3.7;
global_settings {
     assumed_gamma 1
     ambient_light srgb <1,1,1>
}
#declare Grey50 = srgbft <0.5,0.5,0.5,0,0>;
#declare White = srgbft <1,1,1,0,0>;
background {
     color Grey50
   //color White   // Likely use this with Camera01
}
#declare Camera00 = camera {
     perspective
     location <1.2,1.2,-1.2>
     sky <0,1,0>
     angle 35
     right x*(image_width/image_height)
     look_at <0,0,0>
}
#declare Camera01 = camera {
     orthographic
     location <0,1,0>
     direction <0,-1,0>
     right x*(2)
     up <0,0,2>
}
#declare Light00 = light_source {
     <50,150,-250>, White
}
#declare Red = srgbft <1,0,0,0,0>;
#declare CylinderX = cylinder {
     <-1,0,0>, <1,0,0>, 0.01
     pigment { color Red }
}
#declare Green = srgbft <0,1,0,0,0>;
#declare CylinderY = cylinder {
     <0,-1,0>, <0,1,0>, 0.01
     pigment { color Green }
}
#declare Blue = srgbft <0,0,1,0,0>;
#declare CylinderZ = cylinder {
     <0,0,-1>, <0,0,1>, 0.01
     pigment { color Blue }
}
#declare CylinderM = cylinder {
     <0,0,0>, <0,0.5,0>, 0.1
}
#declare Cyan = srgbft <0,1,1,0,0>;
#declare CylinderB = cylinder {
     <0,-0.01,0>, <0,0,0>, 0.11
     pigment { color Cyan }
}
#declare Magenta = srgbft <1,0,1,0,0>;
#declare CylinderT = cylinder {
     <0,0.5,0>, <0,0.51,0>, 0.11
     pigment { color Magenta }
}
#declare BoxTableTop = box {
     <-1,-0.001,-1>,<1,0.001,1>
}
#declare Pigm = pigment {
     image_map { "example.png" once map_type 0 }
     rotate x*90
     translate <0,0,0.3>  // Moving image up some
     warp {
         cylindrical
         orientation z
     }
}
#include "finish.inc"
#declare Ttabletop = texture {
     pigment { Pigm }
     finish { Luminous }
     scale 0.7            // Shrink partly due translate up
     scale <-1,1,-1>
     rotate y*45
}
#declare Tcylinder = texture {
     pigment { color White }
     finish { Mirror }
}
#declare ObjCylinder = object {
     object { CylinderM }
     texture { Tcylinder }
}
#declare ObjTableTop = object {
     object { BoxTableTop }
     texture { Ttabletop }
}

//---
    camera { Camera00 }  // Use to see final result
// camera { Camera01 }  // Use to create distorted image.
light_source { Light00 }
    object { CylinderX } // Axis & cyl top bottom shapes as aids
    object { CylinderY } // Normally comment when using Camera01
    object { CylinderZ }
    object { CylinderB }
    object { CylinderT }
object { ObjCylinder }
object { ObjTableTop }
//---------------------------------------------------------------------------

Bill P.


Post a reply to this message


Attachments:
Download 'camera00.jpg' (93 KB) Download 'camera01.jpg' (63 KB)

Preview of image 'camera00.jpg'
camera00.jpg

Preview of image 'camera01.jpg'
camera01.jpg


 

From: Paolo Gibellini
Subject: Re: Anamorphic images for mirrored cylinder.
Date: 14 Dec 2015 05:50:58
Message: <566e9f12$1@news.povray.org>
William F Pokorny wrote on 08/12/2015 22.43:
> In answer to a question to povray.general yesterday on how to do this in
> POV-Ray I worked up the following code to both create and visualize the
> distorted image from any input image.
>
> [...]
>
> Bill P.

An interesting work! Anamorphic images are always fascinating.
;-)
Paolo


Post a reply to this message

From: Thomas de Groot
Subject: Re: Anamorphic images for mirrored cylinder.
Date: 14 Dec 2015 07:24:45
Message: <566eb50d@news.povray.org>
Paolo reminds me that I forgot to thank you for this code. Fascinating, 
and can become useful one day :-)

-- 
Thomas


Post a reply to this message

From: Bald Eagle
Subject: Re: Anamorphic images for mirrored cylinder.
Date: 23 Apr 2019 14:10:05
Message: <web.5cbf54d89d797d254eec112d0@news.povray.org>
Is there a way to use this to "undo" the reflection of a normal scene in a
cylindrical surface?

So let's say there is a mirror-finish cylinder along axis y.
One renders an HDRI light probe surrounding it, and you see the reflection all
smooshed in the cylinder.

Can one now take this render (assuming this is all you have to start with, so
you have to start ab initio) and undistort the reflection in the cylinder to get
a clear look at what it's reflecting?


What's the best way to do this?
A user-defined camera looking at the image_map of the render?
A camera looking through the appropriate type of lens at the image_map of the
render?
Somehow just stretching the image_map out based on a function?


Post a reply to this message

From: jr
Subject: Re: Anamorphic images for mirrored cylinder.
Date: 24 Apr 2019 10:05:00
Message: <web.5cc06c679d797d25968d6dc0@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> Is there a way to use this to "undo" the reflection of a normal scene in a
> cylindrical surface?
> ...
> What's the best way to do this?

is the stuff discussed in the 'Skewness (long)' thread not solving the same (v
similar) problem?
http://news.povray.org/povray.advanced-users/thread/%3C5bb67852%40news.povray.org%3E/

(completely out of my depth.  :-))


regards, jr.


Post a reply to this message

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