POV-Ray : Newsgroups : povray.general : Simulating Red and Blue Shift Server Time
17 May 2024 19:40:12 EDT (-0400)
  Simulating Red and Blue Shift (Message 1 to 8 of 8)  
From: Sven Littkowski
Subject: Simulating Red and Blue Shift
Date: 31 Mar 2015 08:10:00
Message: <web.551a8e0e42443f295189b500@news.povray.org>
Hi,

I have a cylinder (open, hollow) that has a PNG graphic file as texture. That
image consist only of white dots (blurred edges) and the rest is transparent,
and I want to simulate light speed (or a wormhole travel, whatever).

The texture moves along that cylinder.

Outside of that cylinder is another one with a color_map (red to white to blue).

QUESTION

How can I achieve that of that PNG texture only the white color allows a part of
the outside color_map can shine through? "Filter" and "transmit" seem to be
rejected when using an image. Any idea?

SCENE SOURCE CODE

#declare Warp = texture
{
 pigment
 {
  image_map
  {
   png "Warp - 001.png"
   map_type 1
   interpolate 2
  }
  rotate < 0.0, 0.0, 90.0 >  //
  rotate < 0.0, 90.0, 0.0 > //
  scale < 10000.0, 10000.0, 10000000.0 >
  translate < 0.0, 0.0, (50000.0*clock) >
 }
 finish { ambient 1.0 }
}

#declare LightShift = texture
{
 pigment
 {
  gradient z
  color_map
  {
   [ 0.0 pigment Blue ]
   [ 0.5 pigment White ]
   [ 1.0 pigment Red ]

  }
  scale < 1.0, 1.0, 1000000.0 >
 }
 finish { ambient 1.0 }
}

background { Black }

cylinder // Warp
{
 < 0.0, 0.0, -1000000.0 > < 0.0, 0.0, 1000000.0 > 10000.0
 hollow
 open
 texture { Warp }
}

cylinder // Warp Light Shift
{
 < 0.0, 0.0, -1000000.0 > < 0.0, 0.0, 1000000.0 > 10000.01
 hollow
 open
 texture { LightShift }
}


Post a reply to this message

From: Thomas de Groot
Subject: Re: Simulating Red and Blue Shift
Date: 31 Mar 2015 08:23:59
Message: <551a91df$1@news.povray.org>
On 31-3-2015 14:08, Sven Littkowski wrote:
> How can I achieve that of that PNG texture only the white color allows a part of
> the outside color_map can shine through? "Filter" and "transmit" seem to be
> rejected when using an image. Any idea?
I don't know if this can help you, but when using images you can use the 
following terms:

transmit all or filter all

followed by a value, for instance 0.5, inside the pigment block 
containing the image.

-- 
Thomas


Post a reply to this message

From: Sven Littkowski
Subject: Re: Simulating Red and Blue Shift
Date: 31 Mar 2015 08:30:00
Message: <web.551a9342fbd1e7355189b500@news.povray.org>
Or is there any other way to change just the whites in a distance from white to
blue (-z) and to red (+z)?


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Simulating Red and Blue Shift
Date: 31 Mar 2015 08:55:10
Message: <551a992e$1@news.povray.org>
On 31.03.2015 14:08, Sven Littkowski wrote:

> That image consist only of white dots (blurred edges) and the rest is transparent

It sounds like you might be better of changing the image so that
the background is opaque and the dots are transparent? Then the star
color would be determined by the cylinder texture.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Simulating Red and Blue Shift
Date: 31 Mar 2015 09:53:51
Message: <551aa6ef@news.povray.org>
On 31-3-2015 14:08, Sven Littkowski wrote:
> Hi,
>
> I have a cylinder (open, hollow) that has a PNG graphic file as texture. That
> image consist only of white dots (blurred edges) and the rest is transparent,
> and I want to simulate light speed (or a wormhole travel, whatever).

Another idea: Have you thought about using an absorption media inside 
the cylinder? you might be able to simulate the light shift that way.
-- 
Thomas


Post a reply to this message

From: Sven Littkowski
Subject: Re: Simulating Red and Blue Shift
Date: 31 Mar 2015 16:35:00
Message: <web.551b040bfbd1e7355189b500@news.povray.org>
I like both ideas:
- transparent stars inside black image
- medium inside cylinder

But would a media not slow down the rendering? And it is only the stars that I
want to change the colors from white to red and blue, not the black. But how
would such a media be made? Can you give a sample code?

For working on the suggestion with transparent stars, I will change now the
graphic. Should easily be possible.

Steven




Thomas de Groot <tho### [at] degrootorg> wrote:
> On 31-3-2015 14:08, Sven Littkowski wrote:
> > Hi,
> >
> > I have a cylinder (open, hollow) that has a PNG graphic file as texture. That
> > image consist only of white dots (blurred edges) and the rest is transparent,
> > and I want to simulate light speed (or a wormhole travel, whatever).
>
> Another idea: Have you thought about using an absorption media inside
> the cylinder? you might be able to simulate the light shift that way.
> --
> Thomas


Post a reply to this message

From: Sven Littkowski
Subject: Re: Simulating Red and Blue Shift
Date: 31 Mar 2015 16:45:00
Message: <web.551b0705fbd1e7355189b500@news.povray.org>
Heck, this idea is so simple, I wonder why I didn't get it... :-D




Christian Froeschlin <chr### [at] chrfrde> wrote:
> On 31.03.2015 14:08, Sven Littkowski wrote:
>
> > That image consist only of white dots (blurred edges) and the rest is transparent
>
> It sounds like you might be better of changing the image so that
> the background is opaque and the dots are transparent? Then the star
> color would be determined by the cylinder texture.


Post a reply to this message

From: Thomas de Groot
Subject: Re: Simulating Red and Blue Shift
Date: 1 Apr 2015 03:33:01
Message: <551b9f2d@news.povray.org>
On 31-3-2015 22:31, Sven Littkowski wrote:
> I like both ideas:
> - transparent stars inside black image
> - medium inside cylinder
>
> But would a media not slow down the rendering? And it is only the stars that I
> want to change the colors from white to red and blue, not the black. But how
> would such a media be made? Can you give a sample code?

I was thinking about something like this (not tested) for a cylinder 
oriented along the z-axis:
cylinder {
   <0, -0.5, 0>,<0, 0.5, 0>, 1
   pigment {rgbt <0,0,0,1>}
   hollow
   interior {
     //redshift
     media {
       absorption <0,0,1>
       density {
         cylindrical
         density_map {
           [0 rgb 0]
           [1 rgb 1]
         }
       }
     }

     //blueshift
     media {
       absorption <1,0,0>
       density {
         cylindrical
         density_map {
           [0 rgb 0]
           [1 rgb 1]
         }
       }
     }
   }
   scale MyScale
}

it is possible to vary the absorption value of course as needed and/or 
use a density block inside the media

Drawback might be that you may not be able to use the two media at the 
same time as they coincide. You will have to build in a switch for when 
to use redshift or blueshift.

In terms of dropping render speed, that would be minimal. Scattering 
media is what influences speed most.


-- 
Thomas


Post a reply to this message

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