Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within graphics-3d
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Graphics and 3D Programming
JOGL: cannot use glu.gluCylinder
Adelina Pereteatcu
Greenhorn
Posts: 11
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I am trying to draw a cylinder using the glu.gluCylinder, like that:
private GLU glu; private GLUT glut; //New quadric object GLUquadric quadric = glu.gluNewQuadric(); @Override public void display(GLAutoDrawable drawable) { final GL2 gl = drawable.getGL().getGL2(); gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glColor3f(1.0f, 1.0f, 1.0f); gl.glPushMatrix(); glu.gluCylinder(quadric, 1, 1, 1, 5, 5); gl.glPopMatrix(); }
However, I get a NullPointerException error at the line
GLUquadric quadric = glu.gluNewQuadric();
How should I handle this error in order to be able to use glu.gluCylinder.
Thank you in advance!
Swastik Dey
Bartender
Posts: 2270
20
I like...
posted 5 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
You don't seem to have initialized glu.
Swastik
Adelina Pereteatcu
Greenhorn
Posts: 11
posted 5 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Swastik Dey wrote:
You don't seem to have initialized glu.
I am deeply sorry for the stupid question, but how should I do this?
If I write:
private GLU glu = new GLU();
then I am getting another error:
Exception in
thread
"main" javax.media.opengl.GLException: No OpenGL context current on this thread.
on the line:
GLUquadric quadric = glu.gluNewQuadric();
Is this the real life? Is this just fantasy? Is this a tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
JOGL: the polygon is not showing
Jogl 1.1.1.a: GLJPanel no longer works on Windows10 64 bit
Parsing a text file to an arraylist
JOGL problem
Exception in thread "AWT-EventQueue-0"
More...