> From: "John F. DeGeorge" <[EMAIL PROTECTED]> > Subject: [JAVA3D] Can I use a Stripifier and still access geometry by reference? > To: [EMAIL PROTECTED] > > I am just learning how use geometry by reference to do skin and bone > animation. Previously I had use a Stripifier to turn my basic set of > triangles into strips for efficient display. Can I still use the > Stripifier and maintain references to my original coordinates and normals > (which link back to bones for animation)?? TIA No, that won't work. What you'd have to do is read out the stripified data and create a GeometryArray by-reference with that. (Or else you're going to need to re-stripify each frame, which would be too slow.) But when you read out your data, it will have been converted into strips, so it may be more difficult to understand what you need to change and how you need to change it. Your best bet would be to read it out in indexed format (use getIndexedGeometryArray). The indices and stripCounts won't be changing on a per-frame basis, so you should be able to just update the vertex positions. Your normals, however, will become out-of-date. But my intuition tells me that the time you save by stripifying your data will be more than used up by the extra time it takes you to deal with the by-reference data in strip format. Your best bet will probably be to forget about stripifying. I've attached an email I sent to a customer last week with a similar question regarding using the NormalGenerator with geometry by reference. LMK if you have any more questions. -Paul
> Delivered-To: [EMAIL PROTECTED] > Date: Sat, 25 Aug 2001 09:10:58 -0700 > From: Dola Woolfe <[EMAIL PROTECTED]> > Subject: [JAVA3D] GeomInfo useful to me? > To: [EMAIL PROTECTED] > > Hi, > > I'm using a GeometryInfo on my objects for two > purposes: strippify and calculate normals. Can I still > make use of GeomtryInfo is the locations (but not the > topology) of my vertices are changing? Obviously, the > normals need to be recalculated while strippification > remains in tact. > > My hope is this. Without GeometryInfo I'm able to > create and IndexGeomArray once, make a Shape3D out of > it and then only have to worry about changing the > locations of the vertices. That's what I would like to > keep doing. Right now, I probably missing something as > it appears to me that when the vertices change I need > to kill the old shape and create a new one. Am I > wrong? (Please say "yes".) Well, GeometryInfo isn't really designed to be used this way, but I think it's possible. I've never done it, but maybe someone else has and can point out some potential pitfalls. It would be very tricky. First, forget about Stripifying. NormalGenerator only works on indexed triangles, so you'd constantly be switching back and forth between individual triangles and strips - not good. Your original data should be individual triangles and it should remain individual triangles. What you need to do is read the data out of the GeometryInfo and make your own by-reference GeometryArray. (Don't call GeometryInfo.getGeometryArray()). You should create extra space in the GeometryArray and use validVertexCount to only render those being used. (The vertexCount of a GeometryArray can't be changed after creation, and creating normals may change the vertexCount.) Put the data into the GeometryInfo and generate normals, read it out and put it into your GeometryArray. Next frame change the coordinates within the GeometryInfo (the internal format will now be indexed triangles) regenerate normals and copy into the GeometryArray again. Remember to update validVertexCount. Since GeometryInfo.getCoordinates will return a reference to the data list, you should be able to send this reference directly to the GeometryArray using GeometryArray.setCoordRef3f(). Do all this in the updateData method. LMK how it goes. -Paul > Delivered-To: [EMAIL PROTECTED] > MIME-Version: 1.0 > Date: Sat, 25 Aug 2001 09:10:58 -0700 > From: Dola Woolfe <[EMAIL PROTECTED]> > Subject: [JAVA3D] GeomInfo useful to me? > To: [EMAIL PROTECTED] > > Hi, > > I'm using a GeometryInfo on my objects for two > purposes: strippify and calculate normals. Can I still > make use of GeomtryInfo is the locations (but not the > topology) of my vertices are changing? Obviously, the > normals need to be recalculated while strippification > remains in tact. > > My hope is this. Without GeometryInfo I'm able to > create and IndexGeomArray once, make a Shape3D out of > it and then only have to worry about changing the > locations of the vertices. That's what I would like to > keep doing. Right now, I probably missing something as > it appears to me that when the vertices change I need > to kill the old shape and create a new one. Am I > wrong? (Please say "yes".) > > Thanks! > > Dola > > __________________________________________________ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.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".
