POV-Ray : Newsgroups : povray.newusers : Rendering voxel-style functions in Povray : Rendering voxel-style functions in Povray Server Time
5 Oct 2024 15:29:08 EDT (-0400)
  Rendering voxel-style functions in Povray  
From: twinbee
Date: 6 Sep 2009 11:20:00
Message: <web.4aa3d30f666353bc813aa4820@news.povray.org>
Hi all, I need to be able to render arbitrary functions easily. In other words,
the following function would draw a sphere by checking a giant 3D grid of
say... 100x100x100 voxels to check if the point is in the sphere:

// Check through multiple x, y and z voxels to draw a sphere:
bool sphere(float x, float y, float z) {    // x, y and z are normalized to 1 or
less.
 float f = sqrt(x^2 + y^2 + z^2)
 if (f<1.0) return 1; // Part of sphere
 else return 0;  // Not part of sphere
}

Is this easy to do in Povray or maybe some other 3D software? An equivalent to
voxels would be to trace rays to see if it intercepts the function. Either way
is fine as long as a sphere is produced from the above 'code'/function.


Post a reply to this message

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