One option is to use a texture that is larger than you need and just crop it
using texture coordinates. Remember that your texture does not need to
exactly fit your shape, but you can let the texture coordinates go from 0 to
.75 for example.

However in this case you would need a 1024x1024 texture, which is rather
large and will probably not perform well on most video cards. A general rule
of thumb is to keep the texture size to 256x256, but if performance isn't a
big concern right now, give it a try.

-mike


-----Original Message-----
From: Discussion list for Java 3D API [mailto:[EMAIL PROTECTED]
On Behalf Of Fraser MacLeod
Sent: Wednesday, September 29, 2004 6:31 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Applying texture to terrain

Hi;

I am using a DEM file to generate a virtual terrain (650x1000 grid cells in
the terrain). Using this I am computing those areas of the terrain visible
from a point and storing this as an array (1=visible, 0=non visible for each
grid cell).

I would like to overlay the visiblility information as a texture onto the
terrain - the effect that I want is one where red tinged cells are visible,
and dark tinged cells are non-visible.

I am struggling to find a way of doing this given that the
terrain/visibility arrays are not powers of 2. Is there something like an
ELevationGridGenerator for textures?

Any suggestions more than welcome.

TIA

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