Per,
Yes, this is a known (documented) limitation with Java 3D. Apparently things
have improved with the latest 1.2 release but I have not verified it.
We have a note in our news section about creating lots of unique Appearances
in 1.1.
I think Tess's answer is going to be your only hope as far as what I have
seen in 1.1. I'm not sure that you understood her point, your answer did not
preclude using her method.
Maybe you are using Box or something for your buildings and your are
reluctant to modify the texture coordinates?
There is nothing (in principle) to stop you from creating a composite
texture image that contains all of the graphics for all the sides of your
different types of buildings. You then have to map the corners of your
buildings (assuming the faces are rectangular) to something other than 0 or
1 in either the s or t texture coordinate dimension.
I would take the source code to ColorCube and modify it to include texture
coordinates (taken from Box). I would then modify the ColorCube constructor
to take a pixel offset for s and t into the texture image and a
width/height. You then have to keep "appending" "ColorCubes" to the same
GeometryArray and finally create a single Shape3D from the GeometryArray and
assign an appearance containing the composite texture image.
I.e.
MyBuilding( GeometryArray parentArray, float xGeomSize, float yGeomSize,
float zGeomSize, int nLeftPixel, int nTopPixel, int nWidthPixels, int
nHeightPixels )
Not pretty, but it shouldn't take too long.
I hope that helped. Good luck!
Daniel Selman
PS. I'd be interested to hear what kind of performance increase you get.
[EMAIL PROTECTED]
http://www.tornadolabs.com
-----Original Message-----
From: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]On Behalf Of Per Burstr�m
Sent: 20 December 1999 10:51
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Urgent: Multiple,independant textures on a single
Shape3D
This approach is not usable in my application where I have a lot of
buildings
with different textures on each side.
Is it a known problem that using many Shape3D-nodes results in bad
performance
(10-20 times worse) comapred to putting the same geometry in fewer Shape3D
nodes?
Is there any chance that multiple-textures-per-Shape3D-node could make it
into
the final version of 1.2? Or will there be any other solution?
/Per B
Tess Snider wrote:
> Okay, there is a second solution I have used for multi-texturing, aside
> from making multiple Shape3Ds, but it's very tricky! What I have done in
> the past to achieve the same thing (usually for a 3-D landscape for a
> "Lords of Magic" like game map, where I want grass, ivy, cobblestones,
> rock, shale, and other interesting textures, without making ton of
> different objects) is to either prebuild a single large texturemap to
> cover the whole surface, made out of the independent textures, or, if the
> landscape needs to be built dynamically, dynamically cobble together the
> different textures into one big texturemap on the fly, and glue it on
> there.
>
> The drawback? Large texturemaps can take up lots of video memory! Also,
> it's not always easy to use this method -- especially for objects with
> strange shapes.
>
> This is something I hope they find a solution for, soon. I enjoy writing
> loaders, and I hate having to write a kludge everytime I run into an
> object with multiple textures.
>
> Tess Snider
>
===========================================================================
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".