Hey again,
So I'm trying to follow this tutorial for simple 3D models:
http://www.java-gaming.org/topics/lwjgl-tutorial-series-introduction-to-3d/30712/view.htmlI've modified it slightly, but only in such a way as to split it up into new classes and objects to fit the structure of my project, functionally it acts exactly the same and has most of the rendering code lifted line-for-line.
However, when I run it, I get the following error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f9b1167dee6, pid=3442, tid=140303995508480
#
# JRE version: 7.0_25-b30
# Java VM: OpenJDK 64-Bit Server VM (23.7-b01 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libc.so.6+0x150ee6] __nss_hosts_lookup+0x187e6
#
There's a logfile with more, if posting it would help, but it looks like it's mostly low-level memory stuff which scares me for now.
I've narrowed it down to this section of code:
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glBindBuffer(GL_ARRAY_BUFFER, vboVertexID);
glVertexPointer(3, GL_FLOAT, 0, 0);
glBindBuffer(GL_ARRAY_BUFFER, vboColorID);
glVertexPointer(3, GL_FLOAT, 0, 0l);
glDrawArrays(GL_TRIANGLES,0,12);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
In particular, going through the debugger step by step, I can see that it breaks on glDrawArrays(). Now the funny thing is that if I comment out 'glEnableClientState(GL_COLOR_ARRAY);' and the corresponding glDisableClientState() then it works fine (without the color, of course). I'd like to try getting the color working on this and move on, does anyone have any ideas? If I can provide more code then let me know; as I said, much of it is lifted from the source of that tutorial (he includes source in a link at the end).
EDIT: Oh, I would also like to add that when I leave this block of code uncommented:
glBindBuffer(GL_ARRAY_BUFFER, vboColorID);
glVertexPointer(3, GL_FLOAT, 0, 0l);
I can see that the position of my tetrahedron is moved to the upper-right corner, rather than the center as it was. That might be a clue as to what's off.