Hi group,
thanks to all, who answered.
"Charmaine Lee" wrote:
> The NullPointerException is expected ... So for the first set,
> use the array version of setTextureUnitState.
and "Doug Twilleager" wrote:
> So, there is no bug here.
Oops, my fault, next time I'll read the docs carefully.
"Yazel, David J." clarified:
> ... it looks like he wants to have one texture which is the roof
> and one which is the facade and apply them in the same shape.
> I think it can be done if each piece is in a separate geometry
> if the tex coord set map defined them that way (can you guys
> confirm that?).
That's exactly what I want to do.
> But he cannot split out the texture units within a single
> geometry array unless he is multitexturing (which you would
> not do with a facade and roof texture).
No, I don't really want to have Multitexturing, but currently
seem to have it.
I tried with this code:
protected Shape3D createHouse(int averageFloors) {
...
// map TexUnit 0 to TexCoordinates 0, ignore textUnit 1 ?
int wallTexCoordSetMap[] = { 0, -1 };
QuadArray walls =
new QuadArray(4 * 4,
GeometryArray.COORDINATES
| GeometryArray.TEXTURE_COORDINATE_2,
1, // tried 2 here too
wallTexCoordSetMap);
...
TexCoord2f t = new TexCoord2f();
...
t.set(0f, 0f);
walls.setTextureCoordinate(0, 0, t);
...
// ignore TexUnit 0 (?) map TexUnit 1 to TexCoordinates 1
int roofMap[] = { -1, 1 };
QuadArray roof =
new QuadArray(4,
GeometryArray.COORDINATES
| GeometryArray.TEXTURE_COORDINATE_2,
2,
roofMap);
...
t.set(0f, 0f);
roof.setTextureCoordinate(1, 0, t);
...
Shape3D house = new Shape3D(walls, getHouseAppearance());
house.addGeometry(roof);
return house;
}
But the result is not what I want. The walls are colored unique
with some color from the second (the roof) texture unit.
The same texture coordinates used with 2 Shape3D's (one for the
4 walls, the other for the roof) work just fine.
So I assume, texture units are really only meant for Multitexturing
(shadow maps for instance) and not for having an Appearance with
all Textures in place for one complicated Shape3D built with
several Geometries?
I would really like to read, if this assumption is right, or if
I'm still doing things the wrong way.
Thanks
Georg
___ ___
| + | |__ Georg Rehfeld Woltmanstr. 12 20097 Hamburg
|_|_\ |___ [EMAIL PROTECTED] +49 (40) 23 53 27 10
===========================================================================
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".