Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!goanna!minyos!godzilla!mg From: mg@ (Mike Gigante) Newsgroups: comp.sys.sgi Subject: Re: libsphere - how do I get a sphere into an object? Message-ID: Date: 7 Nov 90 01:51:43 GMT References: <10445@milton.u.washington.edu> <1990Nov5.163639.12230@odin.corp.sgi.com> Sender: news@minyos.xx.rmit.oz.au Distribution: comp.sys.sgi Lines: 39 kurt@cashew.asd.sgi.com (Kurt Akeley) writes: ]In article <10445@milton.u.washington.edu>, ]merritt@milton.u.washington.edu (Ethan Merritt) writes: ]|> I.e.: ]|> sphobj( sphere_object ); ]|> makeobj( spheres ); ]|> for (i = 0; i < nspheres; i++ ) ]|> { ]|> move( &xyz[i] ); ]|> callobj( sphere_object ); ]|> } ]|> closeobj(); ]|> callobj( spheres ); ]|> doesn't seem to do anything other than pile up spheres on top of each other. ]|> ]You're almost there, but you dropped the ball by calling move() to reposition ]the spheres. The way to reposition any GL object, including the sphere ]objects, is to redefine the object-to-eye coordinate transformation by calling ]translate(). Just replace your move() call with a translate() call and things ]should work well. ]-- kurt You probably want { pushmatrix(); translate(x, y, z); callobj( .. ); popmatrix(); } i.e. wrap a push/pop matrix pair around the translate/callobj, otherwise each transform will be accumulated with the previous transforms.. (that is asuming that the x,x,z correspond to the "world coordinate" position of the spheres) Mike Gigante, RMIT Australia