Don't tell me that you are creating 1 (one) geometry object for every triangle or quad! Or worse, one shape3d with it's own geometry and appearance for every quad or tri. Clearly you should agregate them. In your case, I would have 1 shape3d for every Part, at most 2 shapes per Part. From your description, it is quite possible to have even 1 single shape3d! So, here are my hints:
1. if you don't modify the parts individually and all the parts have the same appearance, agregate everything into one single geometry. You'll have to break the quads into 2 triangles. 2. if the first case is not applicable, you should aggregate the geometry per Part, meaning that you take all the quads & triangles belonging to one part and aggregate them into one geometry. Thus, you will have 1 shape3d per part. You will have also to break the quads into triangles. 3. If you don't want to break the quads, then you can have 2 shape3d per part, one containing the triangles and one the quads. Now, regardless of which of the 3 solutions you have chosen, the best way to do the animation is using morphing! Instead of shapes3d, you construct Morph nodes, one for every geometry in your object. In the first case, you will have only one morph object, in the second 1 morph object for every part and in the last case 2 morph objects for every part. Considering your example, that's not too much. For every morph object, you give two geometries, the initial state and the final state. Then you will have to write a Behavior which will set the weights of the two geometries and the appearance of the morph object at every step. It is possible to use the same appearance for all the morph objects. You should have only one behavior to control all the morph objects that you have. The behavior can use an alpha object for smooth deformation, or, for example, you can use a swing gui with a slider to control the morphing state. Moving the slider to the left will deform the geometries to the initial state, moving it to the right it will deform to the final state. Hope you got the ideea: TRY TO MINIMIZE THE NUMBER OF OBJECTS CREATED! Cheers, Florin P.S. for further performance improvements, you should consider the following steps also: a) pass the geometries through the stripifier, so you will have in the best case triangle strips instead of quad arrays and triangle arrays. That will reduce the number of vertices needed to be sent to the graphic card. b) use a geometry reductor to reduce the number of triangles and quads in your scene. -----Urspr�ngliche Nachricht----- Von: Jefferson Samuel [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 3. Februar 2003 05:33 An: [EMAIL PROTECTED] Betreff: Re: [JAVA3D] AW: [JAVA3D] Contour Surface & deform shape Hi Florin, As I have mentioned earlier my Java3D program loads a scene by reading values from a data file. To draw a scene my data file has got three important information. 1)Four points to draw a Quad & the fifth point to denote the PART to which this shape3D belongs. 2)Three points to draw a Triangle & the fourth point to denote the PART to which this shape3D belongs. 3)Number of Parts in the whole scene. A single PART in the scene might contain Quads & Triangles. My data file presents lot of parts (approx. 15), quads (approx. 1000) & triangle (approx 700). I'm creating all these shapes using 1)QuadArray(4, QuadArray.COORDINATES) 2)TriangleArray(3, TriangleArray.COORDINATES) So this constitutes the whole scene. Then come the deformation of the all the shape3D's in the scene... I'm having another data file to read that has all the new values for each Quad & Triangle. Now that I have the old values of the Shape3D and also the new values of the Shape3D I need to deform the Shape3D between these two values. One important issue is that the deformation of the Shape3d's is an animation (with frames and animation rate). So If I want to animate the deformation of a shape3D in 10 frames I generate 10 intermediate values between the old & the new values. I'm applying different colors to the Shape3D's in each frame. The whole process is working fine, but I would like to know form anyone of you whether there is any other good way to improve my performance. 1)Animation is very slow b'coz of the larger number of shape3d's. 2)Applying color-using setAppearance doesn't look impressive. I think I can't use morphing in my case for two reasons. 1)I need to create a duplicate copy of all these Shape3D's, which might slow down the process further. 2)I want to change the appearance of the shape3d during deformation. Can Contours help me in this?? Pls correct me if I'm wrong. With regards Jeff ==========================================================================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".
