Xref: utzoo comp.graphics:16636 comp.graphics.visualization:362 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!rice!uupsi!sunic!news.funet.fi!cc.tut.fi!jk87377 From: jk87377@cc.tut.fi (Juhana Kouhia) Newsgroups: comp.graphics,comp.graphics.visualization Subject: Re: how to view f(x,y,z) = constant surfaces ? Message-ID: <1991Mar15.233844.20616@cc.tut.fi> Date: 15 Mar 91 23:38:44 GMT References: <1991Mar14.234739.15281@athena.mit.edu> Organization: Tampere University of Technology Lines: 28 In article <1991Mar14.234739.15281@athena.mit.edu> chasman@athena.mit.edu (David Chasman) writes: > >My current technique is to evaluate f(x,y,z) for all discretized >(x,y,z) inside of a cube - and to light up a point >if : > | f(x,y,z) - constant | < Epsilon Try use a ray tracing (hopefully you know that method): 1. ray from eye through a pixel to the world Ray = Eye+t*normalize(Pixel-Eye) ; t is distance from eye 2. calculate an intersection points of cube and ray --> t1, t2 3. for (t = t1; t < t2; t = t + small_step) { Ray = Eye+t*Direction; F = f(Ray); if (abs(F-constant) < Epsilon) return Ray; /* point is found */ } /* point is not found */ Rest of this home exam is your job. I use something similar to calculate 4D Mandelbrot. Similarly you can make this algorithm much faster, because you have a mathematical function. Juhana Kouhia jk87377@cs.tut.fi ^^^