0

I wanted to know how to preform texture mapping on the org.lwjgl.util.glu.Cylinder class. I want to be able to wrap the texture around the "Side/Curved" Part of the Cylinder.

This is my main question, but it would also be helpful to know how to preform this on all the "Quadric" classes in lwjgl.util.glu.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Name
  • 2,037
  • 3
  • 19
  • 28

1 Answers1

0

according to the GL reference for glUCylinder:

If texturing is turned on (with gluQuadricTexture), then texture coordinates are generated so that t ranges linearly from 0.0 at z = 0 to 1.0 at z = height, and s ranges from 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75 at the -x axis, and back to 1.0 at the +y axis.

You can find references for the various OpenGL functions at the OpenGL web site. They're for the C versions but the syntax doesn't change much for Java.

If that mapping isn't what you want, you will unfortunately have to write your own code to generate a cylinder model with the correct texture coordinates.

Michael Slade
  • 13,802
  • 2
  • 39
  • 44