You should use a static buffer if you will not be updating the 
vertex/attribute values and a dynamic buffer if you will be updating them. 
I'm not sure how your model loader is giving you back data, but you should 
get a handle for the vbo back when you create the buffer.

On Wednesday, August 22, 2012 9:20:54 PM UTC-5, Braindrool wrote:
>
> I'm fairly new to OpenGL in general, and I was wondering how one might 
> correctly use the vertex / index / color buffer. I created a simple .obj 
> model decoder, but then another problem is here.
>
> Problem #1: Model can not be found.
>
> Problem #2: If I load all models into the vertex buffer, how would I 
> correctly get the offset? Or would that be where dynamic comes in?
>
> The location of the models folder / file:
>
> <http://i.imgur.com/g00A5.png>
>
>
> Code:
>
> package com.braindrool.aftermath;
>>
>>
>>> import java.io.BufferedReader;
>>
>> import java.io.FileNotFoundException;
>>
>> import java.io.FileReader;
>>
>> import java.io.IOException;
>>
>> import java.util.Scanner;
>>
>>
>>> public class ModelLoader {
>>
>>
>>> float[] vertices = null;
>>
>> short[] indices = null;
>>
>>
>>> void loadModel(String name) {
>>
>>
>>> int i = 0;
>>
>>
>>> System.out.println("Loading model " + name);
>>
>>
>>> try {
>>
>>
>>> Scanner scanner = new Scanner(new BufferedReader(new FileReader(
>>
>> "models/" + name)));
>>
>>  while (scanner.hasNext()) {
>>
>> System.out.println(scanner.next());
>>
>> }
>>
>>
>>> if (!scanner.hasNext()) {
>>
>> System.out.println("Done!");
>>
>> scanner.close();
>>
>> }
>>
>>
>>> } catch (FileNotFoundException e) {
>>
>> System.out.println("Model not found");
>>
>> } catch (IOException e) {
>>
>> System.out.println("ModelLoader IO Exception");
>>
>> }
>>
>>
>>> }
>>
>> }
>>
>>  
> ~Braindrool
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to