How can I go about making a basic sphere in libgdx with a texture applied. I do not want lighting.
If i use a lwjgl SPHERE I am unable to see it and do not see how to texture it.
Sphere s = new Sphere();
s.draw(16f, 5, 5);
How can I go about making a basic sphere in libgdx with a texture applied. I do not want lighting.
If i use a lwjgl SPHERE I am unable to see it and do not see how to texture it.
Sphere s = new Sphere();
s.draw(16f, 5, 5);
Hey,
Libgdx does not support primitives as such. You’re on your own.
My advice: Export the sucker from a 3d modeller and load as an obj. Applying texture to that is trivial.
Check this out: http://code.google.com/p/libgdx/source/browse/trunk/tests/gdx-tests/src/com/badlogic/gdx/tests/ObjTest.java
However, if you must create a sphere at runtime you’ll have to implement the creation of the vertices & texture coordinates yourself and stuff them into a mesh. I’m sure you could find quite a few algos on the web re: sphere mesh creation.
Cheers,
Bach
None of the GLUT primitives include texture coordinates except for the teapot (which lwjgl doesn’t even have, though I’ve ported it from jogl). Your first prerequisite is going to be to get even a solid sphere to be visible in your scene.
My first guess is that perhaps you drew it at the origin and that at best you’re looking at half of it from the inside, which won’t be drawn at all if you have backface culling on.