Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => Mandelbulb Implementation => Topic started by: Softology on July 23, 2011, 11:15:44 AM




Title: "Slicing" the 3D surface
Post by: Softology on July 23, 2011, 11:15:44 AM
Hello all.  I need some help with implementing slicing the bulbs.  ie you cut a 3D bulb on the X axis and it shows the cross-section of the 2D brot.

What part of the code needs changing to do this?  I have tried all sorts of things, but cannot get it working.  Any tips highly appreciated.

Thanks,
Jason.


Title: Re: "Slicing" the 3D surface
Post by: cKleinhuis on July 23, 2011, 01:44:53 PM
you just return in your calculation loop

if x>0 return outside ( e.g. maxIter)

that should be it ... if you use a generalized normal calculation ( by shooting 3 rays ) you should get a clean surface....

havent done it myself, but can not see why it should be other ..... correct me if i am wrong ...


Title: Re: "Slicing" the 3D surface
Post by: Jesse on July 24, 2011, 12:25:18 AM
Or just calculate the distance to the plane for the current viewvector, step forward that amount, raystep.
If you already inside, the normal is just that from the cutplane, dependend on which side you are.


Title: Re: "Slicing" the 3D surface
Post by: Softology on July 25, 2011, 01:54:26 AM
Or just calculate the distance to the plane for the current viewvector, step forward that amount, raystep.
If you already inside, the normal is just that from the cutplane, dependend on which side you are.

Any chance could you share a snippet of code for finding the distance to the cutplane(s)?  I have both rayorigin and raydirection as normailized 3D vectors.  I looked around for ray plane intersection info and only got confused.

Thanks,
Jason.