|
|
I was playing with functions, trying to learn about isosurfaces, when I
found something that looked like a "black hole". But I noticed what
looked like some strange shadows or reflections on it, and I cleaned up
my code and have some questions on it.
Basically, it's the log function. In an image with the variable "close"
defined as false you can see the problems as black shapes in the hole.
With close set to true, the camera is moved right into the hole and the
sides are not smooth.
Is this just a limitation of the algorithm used to create isosurfaces?
Or am I doing something wrong?
Two more questions
Can the ?: (conditional) operator be used in a function?
Can vlength() be used in a function? (It kept complaining about the "<"
symbol on the vector I passed it).
Thanks. Code follows:
// Persistence of Vision Ray Tracer Scene Description File
// File: i_test.pov
// Vers: 3.5
// Desc: Testing Isoserfaces - trying to get what I want
// Date:
// Auth: Tom A.
//
#version 3.5;
#include "colors.inc"
global_settings {
assumed_gamma 1.0
}
// ----------------------------------------
#declare close = false;
camera {
direction 1.5*z
right x*image_width/image_height
#if( close)
location <1.0, 4, -1.0>look_at <0.0, 0.0, 0.0>
#else
location <0.0, 20.5, -53.50>look_at <0.0, 0.0, 0.0>
#end
} // camera
sky_sphere { pigment { Black } }
light_source { <0,200, 0> color White }
isosurface
{ function { (y- log( sqrt(x*x+z*z) )*5)
}
contained_by { box { -15, 15 } }
#if (close) // a sort of black whole type grid
texture{
pigment{ gradient z color_map{ [.02 White ] [.02 Clear ] } scale .25 }
finish{ ambient .4 }
}
texture{
pigment{ gradient x color_map{ [.02 White ] [.02 Clear ] } scale .25}
}
#else
pigment{ gradient y scale 7 }
#end
}
Post a reply to this message
|
|