END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. March 29, 2024, 11:52:24 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: How do I colour a Mandelbox?  (Read 3405 times)
0 Members and 1 Guest are viewing this topic.
G
Forums Newbie
*
Posts: 5


« on: December 21, 2010, 08:48:03 AM »

Hey guys,

So I'm currently writing a program to generate pictures via ray-tracing of the mandelbox by using the distance estimation formula. I was wondering if there was any algorithm that assigned unique/interesting colours to different parts of the Mandelbox. Presumably I would have to work off values of the distance from the screen. Is there any other way to do it?

Logged
Tglad
Fractal Molossus
**
Posts: 703


WWW
« Reply #1 on: December 22, 2010, 01:13:59 AM »

Like other 3d escape time fractals you can colour it based on the iteration count of the surface points. This is usually the nicest looking, but I can't give you the details because I forget how you do it exactly.
Another, similar way to colour is to keep a track of how much the point has expanded at the point you draw it (when the max iterations have expired).
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #2 on: December 22, 2010, 11:11:50 AM »

another option is to just use the normalised 3 dimensional point as color wink
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Rrrola
Alien
***
Posts: 23


« Reply #3 on: December 24, 2010, 01:36:10 AM »

Orbit trap: for all iterations, compute the distance from the origin. The color is the smallest distance from these. (It doesn't actually have to be the origin, of course.)
Logged
joeytwiddle
Guest
« Reply #4 on: May 30, 2011, 08:29:43 PM »

One interesting way to choose a colour is by counting the number of times each fold was applied during iteration.  Mandelbulber does this but combines all the counts into one value.

I experimented with building a colour out of the 3 fold counts like this:

Code:
//// Weight the colors because some folds occur more often than others
var multr = Math.pow(0.70, foldCounts.fixedSphere);
var multg = Math.pow(0.99, foldCounts.box);
var multb = Math.pow(0.60, foldCounts.minSphere);
//// Note these numbers get smaller with more iterations, so...

//// Normalise the result (find the ratio)
var maxMult = Math.max(Math.max(multr,multg),multb);
multr /= maxMult;
multg /= maxMult;
multb /= maxMult;

//// Apply lighting separately
data[ptr]   = lightness*multr;
data[ptr+1] = lightness*multg;
data[ptr+2] = lightness*multb;

So redness should correspond inversely to the number of fixedSphere folds, greenness to box folds, and blueness to minSphere folds.  The result is:



At higher iterations further variations on these colours can be found.  It seems unlikely we'll ever see pure red this way though!  wink

The above combination generates somewhat pastel colours as you can see, but I found these reasonably good for picking out bumps with lighting.  But there are many other ways you could visualise the fold counts.

You can try out the application here (Javascript - no WebGL).
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
logo colour scheme 1st Annual Fractal Art Competition 2008 (Completed) lycium 6 5714 Last post April 06, 2008, 09:53:14 PM
by lycium
real colour fractals (new) Theories & Research Tglad 4 1171 Last post March 04, 2010, 10:39:17 PM
by Jesse
Sample colour Maps for M3D (page 2) Mandelbulb 3d « 1 2 » kameelian 29 7032 Last post September 23, 2011, 08:31:05 PM
by DarkBeam
artmatic colour maps for mandelbulb3d Mandelbulb 3d mauxuam 1 3017 Last post December 15, 2011, 06:11:24 PM
by Jesse
jump colour Mandelbulb3D Gallery gaoreji 0 913 Last post July 03, 2013, 05:49:03 AM
by gaoreji

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.274 seconds with 23 queries. (Pretty URLs adds 0.008s, 2q)