Hi Jason,
Try to use TexCoordGeneration, as follows:
app1=new Appearance();
app1.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
app2=new Appearance();
app2.setCapability(Appearance.ALLOW_TEXTURE_WRITE);
tcg1=new TexCoordGeneration(
TexCoordGeneration.OBJECT_LINEAR,
TexCoordGeneration.TEXTURE_COORDINATE_2,
new Vector4f(1,0,0,0),
new Vector4f(0,0,1,0));
tcg2=new TexCoordGeneration(
TexCoordGeneration.OBJECT_LINEAR,
TexCoordGeneration.TEXTURE_COORDINATE_2,
new Vector4f(0,1,0,0),
new Vector4f(0,0,1,0));
app1.setTexCoordGeneration(tcg1);
app2.setTexCoordGeneration(tcg2);
.................
.................
..........
De Vector4f's define planes which define the texture direction. For each
texture x and y direction there is one plane definition. Eg. above, for app1
I set the x-direction along the x-axis, the y-direction along the z-axis.
For app2 it is x-direction along the y-axis and y-direction along the
z-axis. Works for me.
Have fun,
Dirk
----- Original Message -----
From: "Jason Irwin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 11, 2002 3:41 PM
Subject: [JAVA3D] 3D texture
> Hi i was wondering if someone could tell me how to map a texture image
onto the 4 sides (front,back,left and right) of a custom shape. i'm using a
geometryinfo and applying a Texture2D with the following code
>
> buildgeom.setTextureCoordinateParams(1, 2) ;
> buildgeom.setTextureCoordinates(0,texCoord);
>
> This works perfectly for the front and back but i'm not sure how to apply
the same image on the left and right walls (which go along the z axis so
applying a texture image with concern to x and y axis is no good). should i
be applying a texture3d or should i be changing the was i set the
texturecoordinates above. also what exactly do the fields :
>
> int texCoordSet (in the setTextureCoordinates method)
> and
> int numSets (in the setTextureParams method)
>
> both with reference to a geometryinfo, actually refer to.
> thanks
> jason
>
>
===========================================================================
> 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".