Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


lwjgl VBO´s


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 pornosaur   Members   -  Reputation: 112

Like
0Likes
Like

Posted 21 October 2013 - 07:59 AM

Hi everyone,

 I need help. I use VBO for loading object. When it´s loading one object, it´s all right. But when I want loading more object it´s a problem. The first object is rendering well but second object is rendering as first. Could you tell me how rendering multiple objects ? How update VBO?


Edited by pornosaur, 21 October 2013 - 08:00 AM.


Sponsor:

#2 Chris528   Members   -  Reputation: 186

Like
0Likes
Like

Posted 25 October 2013 - 04:43 AM



Hi everyone,

 I need help. I use VBO for loading object. When it´s loading one object, it´s all right. But when I want loading more object it´s a problem. The first object is rendering well but second object is rendering as first. Could you tell me how rendering multiple objects ? How update VBO?

Why not create a simple mesh class with its own vbo and render function?. That way you could create multiple instances of the class using different geometry and put them in a std::vector. When it comes to rendering, just create a loop that goes through the std::vector and calls the render functions.

void init()
{
    ...
    meshes.push_back(new mesh("triangleList1.txt"));
    meshes.push_back(new mesh("triangleList2.txt"));
    meshes.push_back(new mesh("triangleList3.txt"));
    ...
}

void Render(...)
{
    ...
    for (int i = 0; i < meshes.size(); i++)
    {
        meshes[i]->render();
    }
    ...
}

Edited by Chris528, 25 October 2013 - 04:56 AM.


#3 pornosaur   Members   -  Reputation: 112

Like
0Likes
Like

Posted 27 October 2013 - 02:39 PM

Thank you Chris, I understood it. I am a beginner so I probably wrote wrong. Do you have any examples ?



#4 pornosaur   Members   -  Reputation: 112

Like
0Likes
Like

Posted 29 October 2013 - 05:43 AM

Once more thank you! I found my mistake and it is all right - SOLVED.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS