Ken,

There are two ways that spring to mind. The first uses a background image:
Background.setImage and you can draw the gradient using the 1.2
GraphicsContext2D methods. This method is simple but does not repined to
window resizing, so if your Canvas3D is resizable that is problematic. It
will not handle head tilt correctly for large angles.

The second uses Background geometry (Background.setGeometry). Create a unit
Sphere with normals generated inward and assign a generated texture image.
You can draw the gradient into the image using the 2D APIs as before. You
will have to fiddle about to get your texture coordinates right so the image
is aligned nicely with the vertices of the sphere. The nice thing about this
approach is that the gradient really is wrapped around the sphere - you
aren't faking it (which assumes minimal head tilt), and it handles window
resize automatically.

Hope that gives you a start.

Sincerely,

Daniel Selman

[EMAIL PROTECTED]
http://www.tornadolabs.com


-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Kenny-Siu-Ming Tang
Sent: 25 December 1999 22:31
To: [EMAIL PROTECTED]
Subject: [JAVA3D] VRML style background implementation?


Dear all,

I have been trying to implement a BackgroundGeometry object that
displays a gradient color from skyangle and ground_angle...any ideas
of how this could be done? Any hints would be much appreciated.

Regards,
Ken

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