POV-Ray : Newsgroups : povray.newusers : Creating a rotating gem Server Time
23 Dec 2024 01:48:24 EST (-0500)
  Creating a rotating gem (Message 1 to 10 of 23)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Bidski
Subject: Creating a rotating gem
Date: 10 Dec 2010 03:30:01
Message: <web.4d01e47564f2c1cb3c0146760@news.povray.org>
Hi all,

I am trying to make myself a rotating gem. I found some sample code from a
different ray tracer program and proceeded to try and "import" it into POV-Ray.
However, the output that I am getting is far from the intended output and I am
at a complete loss as to what I need to do to fix it.

I have included links to 4 images. The GIF file is what I am trying to achieve.
Stone1.bmp, Stone2.bmp and Stone3.bmp and the outputs that I can get by
modifying the specular and roughness flags but I cant get the full clarity
throughout the picture.

The picture is made by using a mesh of 48 triangles, all with the same texture
and the mesh itself has an interior specifying the IoR and a couple of other
flags.

Can anyone suggest what I might need to do in order to get this looking right?
(I would much prefer (detailed) pointers to answers as an answer would defeat
the purpose of learning)


Thanks in advance
Bidski

http://i288.photobucket.com/albums/ll167/Bidskii/diamondrot.gif
http://i288.photobucket.com/albums/ll167/Bidskii/stone1.jpg
http://i288.photobucket.com/albums/ll167/Bidskii/stone2.jpg
http://i288.photobucket.com/albums/ll167/Bidskii/stone3.jpg


Post a reply to this message

From: Jim Holsenback
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 06:39:15
Message: <4d021163$1@news.povray.org>
On 12/10/2010 04:27 AM, Bidski wrote:
> Hi all,
> 
> I am trying to make myself a rotating gem. I found some sample code from a
> different ray tracer program and proceeded to try and "import" it into POV-Ray.
> However, the output that I am getting is far from the intended output and I am
> at a complete loss as to what I need to do to fix it.
> 
> I have included links to 4 images. The GIF file is what I am trying to achieve.
> Stone1.bmp, Stone2.bmp and Stone3.bmp and the outputs that I can get by
> modifying the specular and roughness flags but I cant get the full clarity
> throughout the picture.
> 
> The picture is made by using a mesh of 48 triangles, all with the same texture
> and the mesh itself has an interior specifying the IoR and a couple of other
> flags.
> 
> Can anyone suggest what I might need to do in order to get this looking right?
> (I would much prefer (detailed) pointers to answers as an answer would defeat
> the purpose of learning)
> 
> 
> Thanks in advance
> Bidski
> 
> http://i288.photobucket.com/albums/ll167/Bidskii/diamondrot.gif
> http://i288.photobucket.com/albums/ll167/Bidskii/stone1.jpg
> http://i288.photobucket.com/albums/ll167/Bidskii/stone2.jpg
> http://i288.photobucket.com/albums/ll167/Bidskii/stone3.jpg
> 
> 
> 
have you explored the glass.inc file that comes with the distribution
... besides textures there are macros that might be helpful ... some ior
defs too

http://wiki.povray.org/content/Documentation:Reference_Section_7.2#glass.inc.2C_glass_old.inc
http://wiki.povray.org/content/Documentation:Reference_Section_7#IORs


Post a reply to this message

From: clipka
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 06:39:18
Message: <4d021166$1@news.povray.org>
Am 10.12.2010 09:27, schrieb Bidski:
> Hi all,
>
> I am trying to make myself a rotating gem. I found some sample code from a
> different ray tracer program and proceeded to try and "import" it into POV-Ray.
> However, the output that I am getting is far from the intended output and I am
> at a complete loss as to what I need to do to fix it.

Gems live from reflection and refraction, so they need some environment 
to be reflected and refracted.

Also make sure you have the IOR right. (If you want to do it really 
good, don't forget dispersion.)


Post a reply to this message

From: Le Forgeron
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 12:34:21
Message: <4d02649d@news.povray.org>
On 10/12/2010 09:27, Bidski wrote:
> The picture is made by using a mesh of 48 triangles, all with the same texture
> and the mesh itself has an interior specifying the IoR and a couple of other
> flags.
>

I did a similar cut with csg a long time ago:
(it's a 3.1 object)

http://jgrimbert.free.fr/pov/brilliant.zip

(preview here:
http://jgrimbert.free.fr/pov/objet.html
)

(object is inside a sphere of radius 1, <0,0,0> is the center of the 
greatest circle)

CSG is simpler than mesh when you need an interior.

You need an environment to reflect, and raise the trace level (really 
raise it, 5 is far from enough with such gem's cut)


Post a reply to this message

From: Alain
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 12:41:42
Message: <4d026656@news.povray.org>

> Hi all,
>
> I am trying to make myself a rotating gem. I found some sample code from a
> different ray tracer program and proceeded to try and "import" it into POV-Ray.
> However, the output that I am getting is far from the intended output and I am
> at a complete loss as to what I need to do to fix it.
>
> I have included links to 4 images. The GIF file is what I am trying to achieve.
> Stone1.bmp, Stone2.bmp and Stone3.bmp and the outputs that I can get by
> modifying the specular and roughness flags but I cant get the full clarity
> throughout the picture.
>
> The picture is made by using a mesh of 48 triangles, all with the same texture
> and the mesh itself has an interior specifying the IoR and a couple of other
> flags.
>
> Can anyone suggest what I might need to do in order to get this looking right?
> (I would much prefer (detailed) pointers to answers as an answer would defeat
> the purpose of learning)
>
>
> Thanks in advance
> Bidski
>
> http://i288.photobucket.com/albums/ll167/Bidskii/diamondrot.gif
> http://i288.photobucket.com/albums/ll167/Bidskii/stone1.jpg
> http://i288.photobucket.com/albums/ll167/Bidskii/stone2.jpg
> http://i288.photobucket.com/albums/ll167/Bidskii/stone3.jpg
>
>
>

Stone1 is the closest to your intended result.
You may need to change your light's position to get optimum result.
Your camera may not be located correctly.
Any gem have an ior, diamond's ior is close to 2.5.
A gem also have variable reflection. That reflection follows the fresnel 
model.
There are some specular highlights.
You need some environment. It can be as simple or complicated as you want.
You may need to adjust max_trace_level. 5 is probably way to small.
Some times, you want to see the light_source... it looks_like{...}
Very low to zero ambient and low diffuse value.
Try to add some dispersion. Stay just a little over 1.
Take a look at glass.inc to get some ideas.
When things are looking good, please use anti aliasing.


Alain


Post a reply to this message

From: Bidski
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 18:20:00
Message: <web.4d02b54b1e34407486c9e330@news.povray.org>
Alain <aze### [at] qwertyorg> wrote:
> Stone1 is the closest to your intended result.
> You may need to change your light's position to get optimum result.
> Your camera may not be located correctly.
> Any gem have an ior, diamond's ior is close to 2.5.
> A gem also have variable reflection. That reflection follows the fresnel
> model.
> There are some specular highlights.
> You need some environment. It can be as simple or complicated as you want.
> You may need to adjust max_trace_level. 5 is probably way to small.
> Some times, you want to see the light_source... it looks_like{...}
> Very low to zero ambient and low diffuse value.
> Try to add some dispersion. Stay just a little over 1.
> Take a look at glass.inc to get some ideas.
> When things are looking good, please use anti aliasing.
>
>
> Alain

Here is the texture and material that I am using for all of the triangles and
the mesh (material for mesh, texture for triangles).
#declare Diamond_Tex = texture
{
  pigment { rgbf <1, 1, 1, 1> }

  finish
  {
    ambient 0
    diffuse 0
    brilliance 0.5
    specular 0.9
    roughness 0.05

    reflection
    {
      colour rgb <1, 1, 1>
      0.1
      fresnel on
    }

    conserve_energy
  }
}

#declare Diamond_Mat = material
{
  texture { Diamond_Tex }

  interior
  {
    ior 2.417
    caustics 1
    dispersion Diamond_Dispersion     // Defined in consts.inc
    dispersion_samples 7
    fade_power 2                      // Used because POV-Ray complained about
me using refraction in the finish, said I should use fade_power and
fade_distance instead.
    fade_distance 1
    fade_colour colour White
  }
}

I added a sphere of radius 5 centered at the origin as an evironment (just added
it) to no effect, I still get the same results as I did. I coloured it white. If
I use rgb <1, 1, 1> with a radius of 10 everything vomes up grey, with a radius
of 5 the whole screen is a complete white-wash, using rgbf/t<1, 1, 1, 1> gives
me the same results as Stone1.bmp (both with a radius of 5 or 10). If I specify
no colour the whole picture is black (can't see the gem at all). Am I doing the
right thing here for an environment?

I had already changed max_trace_level from 5 to 10 (was getting warnings about
it, 10 removed the warnings). However I further changed it to 50 and then 100,
the only change that made was that the top of the gem got brigther and at 100 it
was nearly completely white.

I ran through all the finishes and interioirs in glass.inc. All the finishes
gave results close to that of Stone3.bmp, so i kept my finish. All the interiors
gave little to no change to the one I already had.

One thing that I am noticing is that it spends a lot of time rendering the top
of the gem (the part with the most clarity in Stone1.bmp) and then it chops
through the last part in less than a second (total rendering time is 17
seconds).

Regards
Bidski


Post a reply to this message

From: Jim Holsenback
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 19:11:30
Message: <4d02c1b2$1@news.povray.org>
On 12/10/2010 07:18 PM, Bidski wrote:
> One thing that I am noticing is that it spends a lot of time rendering the top
> of the gem (the part with the most clarity in Stone1.bmp) and then it chops
> through the last part in less than a second (total rendering time is 17
> seconds).

sounds like you need to play with the angle of light_source and/or camera


Post a reply to this message

From: Bidski
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 21:15:00
Message: <web.4d02dd011e34407486c9e330@news.povray.org>
Jim Holsenback <jho### [at] povrayorg> wrote:
> On 12/10/2010 07:18 PM, Bidski wrote:
> > One thing that I am noticing is that it spends a lot of time rendering the top
> > of the gem (the part with the most clarity in Stone1.bmp) and then it chops
> > through the last part in less than a second (total rendering time is 17
> > seconds).
>
> sounds like you need to play with the angle of light_source and/or camera

Ok, I have tweaked the camera angle and the light_source angle and have gotten
some different results (a little better, but still not quite there). I have
attached a picture of what I have now. (stone4.bmp).

The camera used to be

camera
{
  location <0, 2.5, -6>
  look_at <0, 0, 0>
}

and is now

camera
{
  location <0, 0, -5>
  look_at <0, 0, 0>
}

and the light_source used to be

light_source
{
  <0, 0, 0>
  colour rgb <1, 1, 1>
  translate <65, 65, -65>
}

and is now

light_source
{
  <0, 0, 0>
  colour rgb <1, 1, 1>
  translate <5, -5 -5>
}

Keeping in mind that I have a white  of radius 5 centered on the origin, this
places the camera and the light source directly on the edge of the sphere.

Im not really sure how else to twek this now as every tweak I make from here
returns me to what I had before in stone1.bmp.

If I turn conserve_energy off it brightens the gem considerably, but doesnt
change the overall appearance much.

If I have the following inside a finish

reflection
{
  colour rgb <1, 1, 1>
  0.1            // What is this number doing?
  fresnel on
}

Regards
Bidski

http://i288.photobucket.com/albums/ll167/Bidskii/stone4.jpg


Post a reply to this message

From: Jim Holsenback
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 23:00:57
Message: <4d02f779$1@news.povray.org>
On 12/10/2010 10:11 PM, Bidski wrote:
> Jim Holsenback <jho### [at] povrayorg> wrote:
>> On 12/10/2010 07:18 PM, Bidski wrote:
>>> One thing that I am noticing is that it spends a lot of time rendering the top
>>> of the gem (the part with the most clarity in Stone1.bmp) and then it chops
>>> through the last part in less than a second (total rendering time is 17
>>> seconds).
>>
>> sounds like you need to play with the angle of light_source and/or camera
> 
> Ok, I have tweaked the camera angle and the light_source angle and have gotten
> some different results (a little better, but still not quite there). I have
> attached a picture of what I have now. (stone4.bmp).
> 
> The camera used to be
> 
> camera
> {
>   location <0, 2.5, -6>
>   look_at <0, 0, 0>
> }
> 
> and is now
> 
> camera
> {
>   location <0, 0, -5>
>   look_at <0, 0, 0>
> }
> 
> and the light_source used to be
> 
> light_source
> {
>   <0, 0, 0>
>   colour rgb <1, 1, 1>
>   translate <65, 65, -65>
> }
> 
> and is now
> 
> light_source
> {
>   <0, 0, 0>
>   colour rgb <1, 1, 1>
>   translate <5, -5 -5>
> }
> 
> Keeping in mind that I have a white  of radius 5 centered on the origin, this
> places the camera and the light source directly on the edge of the sphere.
> 
> Im not really sure how else to twek this now as every tweak I make from here
> returns me to what I had before in stone1.bmp.
> 
> If I turn conserve_energy off it brightens the gem considerably, but doesnt
> change the overall appearance much.
> 
> If I have the following inside a finish
> 
> reflection
> {
>   colour rgb <1, 1, 1>
>   0.1            // What is this number doing?
>   fresnel on
> }
> 
> Regards
> Bidski
> 
> http://i288.photobucket.com/albums/ll167/Bidskii/stone4.jpg
> 

getting there ... try something other than black background ... also I
find it helpful to have object at <0,0,0> with cam at say <0,0,-10> (or
some other suitable -z dir) with look_at <0,0,0> ... rotate x*15 angles
cam up by 15 deg then rotate y*30 goes clock-wise ... similar setup with
light_source that way it's easier (to me anyways) to keep track of where
everything is. besides the texture ... light position and cam position
(viewing angle) are most important aspect of scene setup. seems like
you're headed in the right direction.


Post a reply to this message

From: Jim Holsenback
Subject: Re: Creating a rotating gem
Date: 10 Dec 2010 23:14:10
Message: <4d02fa92@news.povray.org>
On 12/11/2010 12:00 AM, Jim Holsenback wrote:
thought of this picture after posting:

http://wiki.povray.org/content/File:TutImgRaytracing.gif

thought it might give you some ideas of where you need to be headed with
your setup


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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