Reminds me of fractals... lol...
I wonder if this kind of stuff could be used to make a crude 'plasma' effect...
How long does it take to render one of those images?
]]>http://denvish.net/ulf/090807/49336_laserrend.php
i had to make it render at a higher quality to pick up details:
]]>0.02x³ - 2x² + y² + 2xy - 100 = 0
http://denvish.net/ulf/090807/48838_laserrend.php
----
20cos(0.08y) - 50sin(0.04x) - 0.004xy= 0
http://denvish.net/ulf/090807/48722_laserrend.php
----
next i need to make it render the shapes as solids, shouldnt be too hard, only a bit of changing to do (have to seperate teh different cases a bit etc, but shouldnt be too hard)
]]>The graphs are excellent, I love the "narrowing in" boxes effect, looks very high tech.
]]>Basicly: i split the viewing area into equally sized squares.
for each square:
i evaluate the function for each corner, and also whether that point is inside (if the value is less than 0)
if all are inside, or all are outside, i finish here:
then i go through the following 6 cases:
top left is inside ONLY or outside ONLY
top right is inside ONLY or outside ONLY
bottom left is inside ONLY or outside ONLY
bottom right is inside ONLY or outside ONLY
(top is inside AND bottom is outside) OR (top is outside AND bottom is inside)
(left is inside AND right is outside) OR (left is outside AND right is inside)
then for each case, i use the function values to interpolate linearly for where it is assumed f(x,y) would be 0 from the two function values (not perfect, but a good approximation) then same for the other side for whatever case it is, and draw a line.
---------
the red graph is for the square size of 50pixels (pretty terrible)
the green graph is for the square size of 25pixels (not too bad)
the blue graph is for the square size of 10pixels (almost perfect)
the black graph is for teh square size of 5pixels (perfect for all itensive purposes)
----
0.02x³ - 2x² + y² + 2xy - 100 = 0
http://denvish.net/ulf/090807/32088_laser.php
----
20cos(0.08y) - 50sin(0.04x) - 0.004xy= 0
http://denvish.net/ulf/090807/32340_laser.php
----
i absolutely adore the second graph, and third graph is just immense
--------
thinking about it, this could be directly extended into 3D aswell, only you would have a few more cases to check for, but otherwise it is directly extendable
]]>If you could find one point, say (3,4), you could then try small differences to find the next point, and continue that way following the curve in both directions.
To find the first point you could do a "hill climb" (move in the direction that reduces the error the most), or just a brute-force search dividing the space into (say) 1,000 x 1,000, and then narrowing down further as needed.
Continuous functions would be easiest.
]]>i.e. lets say i have the function:
f(x,y) = 2x^4 - 3x^2y^2 + 2xy - 4x^2 + 5x^3y + 10x + 2 = 0
is there any simple way of being able to render this?
obviously, since its not in the form y = f(x) or x = f(y) i can't just run through values of x,y joining points together, but i know there must be a way, because ive even seen programs that can take implicit functions in 3 dimensions, and render it as a polygonal mesh of arbitrary complexity
---
maybe this would have been better in coders corner, move if appropriate
]]>