Title: More serendipity Post by: Paolo Bonzini on December 17, 2009, 12:05:59 AM So I made a mistake in converting some formulas from triplex to quaternions and came up with the following:
qx = real(zri); qy = imag(zri); qz = zj; f2 = cabs(zri) if f2==0.0 f2 =0.0001 endif if @mpwr==2 f2 = qz/f2; q1w = qx; q1x = qy*f2; q1y = -qx*f2; q1z = qy; qx = q1w*q1w + q1x*q1x - q1y*q1y - q1z*q1z; qy = 2*(q1x*q1y + q1w*q1z); qz = 2*(q1x*q1z - q1w*q1y); else xz2 = 2*qx*qz; f2 = xz2/f2; q2w = qx*qx-qy*qy-qz*qz; q2x = qy*f2; q2y = -qx*f2; q2z = 2*qx*qy; if @mpwr==4 qx = q2w*q2w + q2x*q2x - q2y*q2y - q2z*q2z; qy = 2*(q2x*q2y + q2w*q2z); qz = 2*(q2x*q2z - q2w*q2y); else q4w = q2w*q2w - xz2*xz2 - q2z*q2z; q2w2 = 2*q2w; q4x = q2w2*q2x; q4y = q2w2*q2y; q4z = q2w2*q2z; qx = q4w*q4w + q4x*q4x - q4y*q4y - q4z*q4z; qy = 2*(q4x*q4y + q4w*q4z); qz = 2*(q4x*q4z - q4w*q4y); endif endif zri = qx + flip(qy) + cri zj = qz + cj magn = |zri| + sqr(zj) This is ready to be plugged in David's MMFWIP3 file for ultrafractal (which btw works great under Wine). It works for powers of 2,4,8. It has no support for distance estimation, but maybe the formula for normal Mandelbulb works (if I understood the formula correctly). From zooming it looks like a new kind of taffy, however it has some nice 3D spikes; z^2 is more impressive than z^8 for this fractal. I'm not sure as I didn't really understand how to move the camera in David's formulas. Title: Re: More serendipity Post by: Paolo Bonzini on December 17, 2009, 12:14:33 AM And here is the z^8 version (from the side). The horns are interesting, but it is definitely "whipped"...
Title: Re: More serendipity Post by: David Makin on December 17, 2009, 01:18:04 AM From zooming it looks like a new kind of taffy, however it has some nice 3D spikes; z^2 is more impressive than z^8 for this fractal. I'm not sure as I didn't really understand how to move the camera in David's formulas. Hi Paolo, the view is controlled by specifying a target (x,y,z) then the direction and distance of the viewing plane from the target - using the two "Camera Rot" angles and the "Camera distance" parameter. The perspective is controlled by the "Image plane distance" which specifies how much further from the target the viewpioint is than the image plane - use smaller values here for wider angle/larger FOV. With the camera at a given position based on the above you can then also specify an alteration of the camera's viewing direction using the "Camera Dir." angle parameters (changing these from zero rotates the viewplane and viewpoint around the centre of the viewplane). Note that the angle parameters are specified in degrees. Title: Re: More serendipity Post by: Paolo Bonzini on December 17, 2009, 01:21:49 AM Hi Paolo, the view is controlled by specifying a target (x,y,z) then the direction and distance of the viewing plane from the target - using the two "Camera Rot" angles and the "Camera distance" parameter. The perspective is controlled by the "Image plane distance" which specifies how much further from the target the viewpioint is than the image plane - use smaller values here for wider angle/larger FOV. Heh, that I understood; the problem is getting the camera to move where I want. ;-)With the camera at a given position based on the above you can then also specify an alteration of the camera's viewing direction using the "Camera Dir." angle parameters (changing these from zero rotates the viewplane and viewpoint around the centre of the viewplane). Note that the angle parameters are specified in degrees. Title: Re: More serendipity Post by: David Makin on December 17, 2009, 01:27:52 AM Heh, that I understood; the problem is getting the camera to move where I want. ;-) A small trick: Set the "Camera distance" to say 1e-8 and then for most purposes the "target" coords are essentially the camera coords. |