Hi Ajax,
 
I don't know whether is this what you are trying to do but try inserting these lines into your code.
 
TexCoordGeneration tcg = new TexCoordGeneration(TexCoordGeneration.SPHERE_MAP, TexCoordGeneration.TEXTURE_COORDINATE_2);
 
app.setTexCoordGeneration(tcg);
 
Hope it helps.
 
-Alex-
----- Original Message -----
From: ajaxinc
Sent: Tuesday, September 10, 2002 5:02 PM
Subject: Re: [JAVA3D] texture mapping

Hi Alex,
           I tried what you have suggested. It works to some extent ie. the texture was loaded but only a part of it. For eg suppose there is a jpg with three vertical strips with colors red/white/blue,  and if I texture map this jgp on a sphere with radius as per cmds given by you, then sphere looks blue at all point on the sphere surface. So what must be happening?
                                                                         =
                                                                         =
       Ajax.

----- Original Message -----
From: Alex Hew
Sent: Monday, September 09, 2002 6:23 PM
Subject: Re: [JAVA3D] texture mapping

Hi Ajax,
 
TextureLoader load = new TextureLoader("c:/model/grass.jpg", null);
Texture text = load.getTexture();
 
 Appearance app = new Appearance();
 app.setTexture(text);
 Shape3D shape = new Shape3D(geometry, app);
 
I did it this way. Hope it helps.
 
-Alex-
----- Original Message -----
From: ajaxinc
Sent: Monday, September 09, 2002 8:32 PM
Subject: [JAVA3D] texture mapping

what is the simplest way to texture map a jpg over a shape3D

Reply via email to