Hi, Samuel
javax.swing.Timer has the same low precision as System.currentTimeMillis()
has in some OSs:
Win98 - ~50ms; (no good no animation)
Win2k ~10ms; (acceptable)
So take care if you use it for animation/benchmark.
I guess a behavior with wakeuponElapsedframes(0) is a better approch for
benchs.
Alessandro
----- Original Message -----
From: "Jefferson Samuel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 18, 2003 9:29 AM
Subject: [JAVA3D] SetCoordinates or setCoordRef3f ?? Which one updates the
vertex faster ??
> Hello All,
>
> Shape3D objects are created using GeometryArray subclasses that contains
separate arrays of positional coordinates. I have another new set of
positional coordinates that I need to use to update or deform the Shape3D
objects. I wish to have this deformation of shape3D's as a smooth animation
in correspondence with changes in the node component(like
Material,TransparencyAttributes,..)
>
> I want the same Shape3D to be deformed into a new one. No Morphing.
> I have this process done in two ways I) By copying vetex data & using
setCoordinates() & II) by passing a reference & using setCoordRef3f().
>
> Both methods update the coordinates of the Shape3D's in each frame.
Animation (deformation) is very slow. I'm using javax.swing.Timer to control
the deformation of the Shape3D's in each frame.
>
> 1) Is animation is slow due to rendering frames through Timer control??
> 2) SetCoordinates or setCoordRef3f ? Which of these to methods update the
shape3D faster??
> 3) Can we change the NodeComponent (changing the Material Component)
attached to a Shape3D when updating the vertex data of the same inside
GeometryUpdater.updateData() method??
>
> public void updateData(Geometry geometry)
> {
> ..
> ((Shape3D.getAppearance()).getMaterial()).setEmissiveColor(DarkBlue);
> ..
> }
>
> I tried doing this in Java3D->demo /GeometryByReferenceTest.java and I was
able to change the Material property of that Shape3D inside the updataData()
method.
> But when trying the same in my program with all the capabilities set, it
doesn't work more than once. The program just hangs without throwing any
error or exception after setting the Material property once.
>
> Copying data:
> m_OriginalGeometryArray = (GeometryArray)SHAPE3D.getGeometry( );
> //new positional coordinates are stored under deformedVerts (double)
> m_OriginalGeometryArray.setCoordinates(0,deformedBulbVerts );
> SHAPE3D.setGeometry(m_OriginalGeometryArray);
> SHAPE3D.setAppearance(bulbApp);
>
> By Reference:
> // new positional coordinates are stored under m_OrgPoint3f (Point3f)
> ((GeometryArray)( SHAPE3D.getGeometry())).setCoordRef3f(m_OrgPoint3f);
>
>
> Capability Set:
> Shape3D.ALLOW_GEOMETRY_READ/WRITE
> Shape3D.ALLOW_APPEARANCE_OVERRIDE_READ/WRITE
> Shape3D.ALLOW_APPEARANCE_READ/WRITE
> GeometryArray.ALLOW_COORDINATE_READ/WRITE
> GeometryArray.ALLOW_REF_DATA_READ/WRITE
> Appearance.ALLOW_MATERIAL_READ/WRITE
> Material.ALLOW_COMPONENT_READ
>
>
> Any kind of help is greatly appreciable. Thank u.
>
>
> -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".
_______________________________________________________________________
Busca Yahoo!
O servi�o de busca mais completo da Internet. O que voc� pensar o Yahoo! encontra.
http://br.busca.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".