Texture mapping coordiantes are pairs of floats normally refred to as
(u,v). u is the horizontal position on the texture image, and v is the
vertical position on the texture image.
Your texture coordiantes:
Point on Quad Texture Coordinate
Position on Quad
top-left (A) 0.0f,0.0f top-left
top-right (B) 1.0f,0.0f top-right
bottom-right (C) 0.0f,1.0f bottom-left
bottom-left (D) 1.0f,1.0f bottom-right
u and v are in units of 1.0 which is equal to the full widge/height of the image.
So I think you're coorindates should be :
float[] textco = { 0.0f, 0.0f, 1.00f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f,
0.0f, 1.0f, 1.00f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f};
Kev
Ben Moxon wrote:
>How can I make my textures face "out" of my objects- they all seem to just want to
>point along the Z- direction so any faces I create that are at 90 degrees to this
>just don't show properly at all.
>
>Basically, I've got my object created like this:
>
> int[] stripCounts= new int[2];
> stripCounts[0]=4;
> stripCounts[1]=4;
> int[] contourCount=new int[2];
> contourCount[0]=1;
> contourCount[1]=1;
> Point3f[] pts=new Point3f[8];
> // front
> pts[0]=A;
> pts[1]=B;
> pts[2]=C;
> pts[3]=D;
> // back
> pts[4]=D;
> pts[5]=C;
> pts[6]=B;
> pts[7]=A;
>
> GeometryInfo gi = new GeometryInfo(GeometryInfo.POLYGON_ARRAY);
> gi.setCoordinates(pts);
> gi.setStripCounts(stripCounts);
> gi.setContourCounts(contourCount);
>
>I know I need to set my texture arrays next, but I can't work out enough from the
>docs and various books I have around to make them work. I can create an array of
>floating points that loads fine as a texture co-ordinate set, like this:
>
>float[] textco = { 0.0f, 0.0f, 1.00f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f,
> 1.0f, 1.0f, 0.00f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f};
>gi.setTextureCoordinateParams(1, 2);
>gi.setTextureCoordinates( 0, textco );
>
>The problem is that I don't actually understand where these points are mapping to- I
>am still a bit new to the language of 3d programming ( I'm fine with the concepts,
>but I don't always know the names ) so I'm finding it very tricky to actually match
>one to the other.
>
> For a set of points like:
>
>A = (0.0, 1.0, 0.0)
>B = (0.0, 2.0, 0.0)
>C = (0.0, 2.0, 4.0)
>D = (0.0, 1.0, 4.0)
>
>I just get a cross section of the texture right along the face.
>
>I know this is probably another a really obvious question but how does the
>co-ordinate mapping work?
>
>thanks,
>
>-ben
>
>
>---------------------------------------
>Ben Moxon
>newview communications limited
>[t] 01483 845394
>[e] [EMAIL PROTECTED]
>[w] www.newview.co.uk
>
>=========================================================================
>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".