POV-Ray : Newsgroups : povray.programming : Using julia_fractal as a pattern type : Re: Using julia_fractal as a pattern type Server Time
28 Jul 2024 18:13:12 EDT (-0400)
  Re: Using julia_fractal as a pattern type  
From: Ron Parker
Date: 7 Dec 1999 08:25:57
Message: <384d0ae5@news.povray.org>
On 7 Dec 1999 07:34:21 -0500, Nieminen Juha wrote:
>  1) Can I use an object definition as a pattern type? If yes, what would be
>the easiest way?

Probably, yes.  The easiest thing to do is probably start with Chris Huff's 
object-based pattern code, because he's probably already gone to the trouble 
to add a pointer to the associated object (and associated constructor/copy/
destructor code) to TPAT_FIELDS.  He'll also have added some parse code you
can use as an example of how to do it yourself.

>  2) Is there any way in the existing julia_fractal code to get the number
>of iterations (and other information) for a specific point in space?

A fractal object has "virtual functions," one of which is (rougly)
Iterate( vector, fractal *).  That function returns true if the iteration
count exceeds the maximum, else it returns false.  With application of 
some elbow grease, you could change the implementations of that function
(in quatern.c, one for each evaluation method) to take a pointer to an 
iteration count in addition.  You wouldn't even have to change any of 
the current places it gets called, since it gets called through a macro
defined in fractal.h.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

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