This is what I do.  I scale the image *once* and set it as the background
image *once*.  After I do this performance is bad.

And I am considering doing as you suggest, and as I mentioned, coding an
onresize event when the window size is changed to rescale the background
image.

But at this point, I don't think I want to use any background image because
of the big performance hit.

Cheers,
Bob Gray

-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Michael Latta
Sent: Saturday, July 27, 2002 12:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Background image questions


You would be better off scaling the image once and then setting the scaled
image
as the background.  You could resize and reset the background image on
window size changes
using the Swing events rather than the J3D events.

-----Original Message-----
From: RWGRAY [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 27, 2002 10:17 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Background image questions


I just tried, for the first time, specifying an image for the Background.

It works O.K., but...

Performance is now *really* bad.  Scene rotations (rotating the
ViewPlatform) is now very jumpy.

I coded

ImageComponent2D ic =
  new TextureLoader("C:/G/J3DProjects/nch5/NCH5/classes/nch5/test.jpg",
  this).getScaledImage(AB.ScreenProperties.width,
AB.ScreenProperties.height);

AB.theBackground.setImage(ic);


As soon as I remove the background image, performance returns to normal.

1) Why should this be?

2) If I just do a getImage instead of the getScaledImage, the background
image does not fill the entire canvas and is positioned in the upper left
corner.  How can I move it to the center of the canvas?

3) And keep it in the center as I change the canvas window size by dragging
the edge of the window with the mouse? (I can code an onresize event, but I
am wondering is there is something in Background that I don't know that
would do this automatically.)

Cheers,
Bob Gray

===========================================================================
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".

===========================================================================
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".

===========================================================================
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".

Reply via email to