|
Dear all:
In my case, I have many images to show on one
plate.
To improve the performance, I use the by-reference
ImageComponent2D object in my Texture2D object and implement
ImageComponent2D.Updater interface.This is working , but I find that when J3D
invokes the updateData method, the execution performance is severely
degraded. All the thing what I do only spent 20 ms in the updateData
method, but J3D invokes updateData method totally spent 45 ms, why ? and how to
solve it ? There is part of my code
below.
sincerely
Thanks
Greg
/**
* Set texture of geometry by changing texture reference.
* I implement ImageComponent2D.Updater interface in this
class.
*/ private void changeTextureByRef( ) { m_Image2D.updateData( this, 0, 0, m_Image2D.getWidth(), m_Image2D.getHeight() ); => this method
invoking spent about 45 ms
} /*
* Updates image data that is accessed by reference.
*
m_ObjectImage is a BufferedImage object and
* hold the
reference of the image of the texture.
*/
public void
updateData(ImageComponent2D
imageComponent,
int x, int y, int width, int height) {
m_ObjectImage = m_ObjectMovie.getTexureImage( m_CurrentIndex, m_ObjectImage
);
=> this method invoking spent about 15
ms
LISImageUtilities.flipImage( m_ObjectImage );
=> this method invoking spent about 5
ms
} |
