VBO Offsets

Hello,

Perhaps my question is obvious, but I cant find a solution, maybe you can help me:
I have a scene with a large set of objects. I’m trying to setup a big vbo which will contains all vertices, and draw every object trough an offset to the so called big array. Mi problem is this: in java there aren’t “pointers neither offsets”, so the compiler complains to me when I try to pass an int in the latest glVertexPointer parameter. I can’t figure how to pass the offset, so any help will be nice.

Thanks,
Jacobo

There is 2 glVertexPointer functions:
glVertexPointer(int size, int type, int stride, Buffer ptr)
glVertexPointer(int size, int type, int stride, long ptr_buffer_offset)

The second is used with vbos to pass in the offset.

Check again that your parameters are correct.

The compiler still complains. Perhaps I need download the latest night build? I am using the 1.1.1 July 12 build https://jogl.dev.java.net/servlets/ProjectDocumentList?folderID=3726&expandFolder=3726&folderID=2771. I think that this is the last one, isn’t it?

There is a newer called JSR-231 beta 01 - October 27. The function is in the browsable javadoc on the jogl site. So I think you’ll need to upgrade.

There probably is a way to pass in the offset in your version but I don’t know how. Maybe passing in a IntBuffer where it first element is the offset. Just a guess.

Currently I am in production process, so I can’t base my develop in a beta (I must wait for the release :confused: ) But I’ve just found a way to perform that operation using BufferUtils, creating an offsetBuffer (it seems that I didn’t dive enought deep in the documentation). Anyway, thanks for the help