Dear Andreas, Thanks for your help! I believe using scaled transform group is the best possible way my purposes. Fortunately, I had used TG's in my java3d code and I could code your suggestion in seconds :) this kind of memory leaks only occurs in cases of using shared geometries. and Primitives cache geometries. Turning this feature off will solve the problem too :)
Sincerely, Mehrtash --- Andreas Jerke <[EMAIL PROTECTED]> wrote: > Hi Mehrtash, > > perhaps I missunderstand you, but > isn't it easier to put a TG above your > Shape3D object and modify the scaling (X,Y or Z, > depending > on your cylinder)? > If you create a Cylinder with length = 1 you could > set the new length by modifing the scale (X,Y or Z) > factor in your TG. > > regards, > Andreas > >-----Original Message----- > >From: Discussion list for Java 3D API > >[mailto:[EMAIL PROTECTED]] On Behalf Of > Mehrtash Babadi > >Sent: Sonntag, 19. Mai 2002 13:07 > >To: [EMAIL PROTECTED] > >Subject: [JAVA3D] Memory Leak in Cylinder Geometry > Update > > > > > > Dear members, > > > > I am having a problem in my java3d code. > > suppose I want to place a Cylinder in my > > virtual universe and I want to change its > > length. to do so, I construct a new Cylinder > > with the new properties. then I get its geometry > > and set the old cylinder's geometry to the new > one. > > > > a pseudocode is something like this: > > > > Cylinder newCylinder = > > new Cylinder(blah, blah, blah...); > > > > > newCylinder.getShape(Cylinder.BODY).setCapability > > (Shape3D.ALLOW_GEOMETRY_READ); > > > newCylinder.getShape(Cylinder.BODY).setCapability > > (Shape3D.ALLOW_GEOMETRY_WRITE); > > > > (and the same lines for Cylinder.TOP and > > Cylinder.BOTTOM) > > > > oldCylinder.getShape(Cylinder.BODY). > > getGeometry(geom); > > oldGeom = null; > > newCylinder.getShape(Cylinder.BODY). > > getGeometry(geom); > > oldCylinder.getShape(Cylinder.BODY). > > setGeometry(geom); > > > > newCylinder = null; > > geom = null; > > > > (and again, the same lines for Cylinder.TOP and > > Cylinder.BOTTOM) > > > > clear and simple. but, unfortunately, i face an > > unpleasing memory leak. I have no time at this > > moment for further investigations with JProbe or > > JOptimizeIt and I'm composing this letter > > in a big hurry! Any comment or help is > > much appreciated! I'll be glad to hear better > > and faster ways or a way to prevent memory > > leaks! > > > > Sincerely, > > Mehrtash > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] > and include in the body > of the message "signoff JAVA3D-INTEREST". For > general help, send email to > [EMAIL PROTECTED] and include in the body of the > message "help". __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
