Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7848427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:11:55+00:00 2026-06-02T18:11:55+00:00

I want to render an object imported from wavefront obj file. The object has

  • 0

I want to render an object imported from wavefront obj file. The object has multiple groups and materials:

# group one
g one
v ...
vt ...
vn ...
# material A
usemtl ...
f ...
# material B
usemtl ...
f ..

# second group
g two
v ...
vt ...
vn ...
# material C
usemtl ...
f ...
# material D
usemtl ...
f ...  

The different parts of the model need to be rendered separately, as they have different materials.

I will build a container with an information about the model and I would like to know what is the best/common way to organize the “queue” of the objects to render.

My idea, which I don’t know if it’s good is the following (with pseudocode): for each group g store all vertex information in object VertexInformation g1, g2 and for each usemtl store information about faces (and the used material) in FaceInformation f1, f2, f3, f4.

Then the rendering would look as follows:

load vertices g1
render f1 f2
load vertices g2
render f3 f4 

Or maybe better to load all the vertices from g1 and g2 at once?

Is that the way? Or it has some giant drawbacks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:11:58+00:00Added an answer on June 2, 2026 at 6:11 pm

    I would to suggest you to declare the interface IModel and implement it in a different models like WavefrontModel so:

    class IModel{
    public:
     virtual bool drawModel() =0;
    };
    
    class WavefrontModel : public IModel{
    public:
      bool drawModel();
    };
    

    I have an example for you here:
    http://code.google.com/p/gstmultimedialib/source/browse/#svn%2Ftrunk%2Fgstmultimedialib%2FGLEngine%2FGLEngine%2FModel

    If you want you can get the glEngine module from this project.

    After that implement your scene or device which will contain a list of your models.

    class Device{
    private:
     std::list< IModel* > m_models;
    
    public:
     bool drawScene(); //iterate all of your models and call the draw method here.
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to render an object from my controller to a jQuery callback function.
If I have an object say @user and I want to render only certain
i want to render one of these sets of views: head body-$id1 foot OR
I want to render same template on one page which should display the value
I have a JSON object items which has few items that I want to
I want to render my scene in one thread and then blit the result
I want to render a partial in my js.erb file so I can use
Basically I have a set of object values I want render in 2 separate
I want to render a profile user container that contains a list of labels
I want to render for facebook bot special data. I have og.html.erb <!DOCTYPE html><html><head>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.