Xref: utzoo comp.sys.sgi:8327 comp.graphics:16013 Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!wind.Eng.Sun.COM From: naughton@wind.Eng.Sun.COM (Patrick Naughton) Newsgroups: comp.sys.sgi,comp.graphics Subject: Re: Meta-Ball Rendering anyone? Message-ID: <8046@exodus.Eng.Sun.COM> Date: 15 Feb 91 20:21:18 GMT References: <84263@sgi.sgi.com> <1991Feb8.094953@anusf.anu.edu.au> <1991Feb13.114334.86303@vaxc.cc.monash.edu.au> Sender: news@exodus.Eng.Sun.COM Reply-To: naughton@wind.Eng.Sun.COM (Patrick Naughton) Followup-To: comp.sys.sgi Organization: Sun Microsystems, Inc. - Mountain View, CA Lines: 108 phs424l@vaxc.cc.monash.edu.au writes: |> |> drw900@anusf.anu.edu.au ("Drew R Whitehouse") writes: |> > |> /* |> > |> * Hi - |> > |> * I've been trying to get this Meta-Ball renderer |> > |> * to work for me with no success. Does anyone out there |> > |> * know of a public domain Meta-Ball renderer, or does |> > |> * anyone know how to make this program stop core dumping? |> > |> > |> > |> > Here's something to try out, it produces a picture - I'm not |> > sure if this was what they looked like in the article !! |> |> Is this for a Silicon Graphics machine? If not, what? |> Daf. |> -- |> ------------------------------------------------------------------------------- |> Davyd Norris : "Strange people physicists... In my opinion |> Physics Dept. : those that aren't already dead are in some |> Monash University, : way very, very sick." - Douglas Adams, |> Vic, Australia. : "The Long Dark Tea-time Of The Soul" |> ------------------------------------------------------------------------------- Yes it is for the SGI as is... but link it with this file and it will run on X11. (You'll need a 24 bit screen to make it work well...:-) #include Display *dpy = 0; int screen; Colormap cmap; GC gc; Window win; int winw; int winh; void prefsize(w, h) { winw = w; winh = h; } void winopen(name) char *name; { dpy = XOpenDisplay(0); screen = DefaultScreen(dpy); cmap = DefaultColormap(dpy, screen); gc = DefaultGC(dpy, screen); win = XCreateSimpleWindow(dpy, RootWindow(dpy, screen), 0, 0, winw, winh, 1, 0); XSelectInput(dpy, win, ExposureMask); XStoreName(dpy, win, name); XMapWindow(dpy, win); while (1) { XEvent ev; XNextEvent(dpy, &ev); if (ev.type == Expose) break; } } void RGBmode() { } void gconfig() { } void RGBcolor(r, g, b) { XColor color; color.pixel = 0; color.red = r << 8; color.green = g << 8; color.blue = b << 8; color.flags = DoRed | DoGreen | DoBlue; XAllocColor(dpy, cmap, &color); XSetForeground(dpy, gc, color.pixel); } void clear() { XFillRectangle(dpy, win, gc, 0, 0, winw, winh); } pnt2i(v, w) int v; int w; { XDrawPoint(dpy, win, gc, v, w); } -- ______________________________________________________________________ Patrick J. Naughton email: naughton@sun.com Sun Labs vmail: (415) 336 - 1080