float[] textco = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f
0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f};
The texture reading backwards if you face the shape away is what you'd expect
with the appropriate mapping coordinates, you just need to reverse the U
coordinates for the other side.As to the cross-section texture thing, that is very wierd. As long as you keep the points and texture coordinates lined up you should get the same texture however you turn the shape. Are you just rotating the existing shape? Or are you constructing a new one maybe a different vertex order or texture coordinate array?
Kev
Ben Moxon wrote:
[EMAIL PROTECTED]">Thanks, thats a really big help.
It makes things a lot clearer but it seems that no matter how I change the co-ordinates the texture still behaves like a stick of rock - If I have a shape facing the viewer with the words "BlackPool Rock" written on it you can read them fine, but if I have a shape that goes "along" the rock it will just have a cross-section of the letters at that point right along it and if I have one facing away I will get the words "blackpool rock" written backwards on it.
Is this actually a co-ordinate problem or is their some texture wrapping feature I haven't thought to switch on?
-ben-----Original Message-----
From: Kevin Glass [mailto:[EMAIL PROTECTED]]
Sent: 14 June 2002 14:27
To: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] All my textures face the same way
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- theyall 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'twork 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 thesepoints 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 questionbut 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] andinclude in the bodyof 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".
=========================================================================
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".
