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 8173569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:12:18+00:00 2026-06-06T22:12:18+00:00

I wrote a collada loader for my model viewer. Write now it loops through

  • 0

I wrote a collada loader for my model viewer.

Write now it loops through all the vertices and indices and creates and index and vertice buffer so I can render the mesh.

If the model is not triangulated I have two options. I can either traingulate the indices as they are written to my buffer (ie calculate and add more indices to create triangules).

Or I can trinagulate the entire mesh before I write my buffers and leave my buffer system as is (it will assume that the mesh is triangulated before hand).

In order to trangulate the model before hand I would need to load the entire thing into a linked list loop through the list and insert new indices to hack up the 4+ polygons into tirangles.

If I triangulated as I wrote the mesh I would need to dely the writing of 4+ polygons, put them into a seperate buffer, then when that buffer had the entire 4+ polygon in it, triangulate it and write the new indices.

This would essentially add another for loop that would only be triggered each time it encountered a 4+ triangle.

This is by far the most complex thing i’ve written so far so and i’m having a really hard time wrapping my head around which direction will be more effecient.

One involves double the ammount of memory I am using by duplicating the entire mesh so I can procces it, the other involves a nested for loop that is only triggered when it encounters 4+ polygons.

Can anyone offer any advice as to how I might gauge the complexity of the two options without acutally writing and testing both?

  • 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-06T22:12:19+00:00Added an answer on June 6, 2026 at 10:12 pm

    Adding an inner loop to handle an occasional condition is fine. If I understand your problem correctly, you will need to test for polygons and triangulate them as necessary one way or another; a conditionally executed inner loop is appropriate reflection of this.

    If you think the inner loop will make your function too long/ugly/difficult-to-read, you can write a separate “triangulate_polygon()” function containing the inner loop, and call it conditionally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive been able to load static geometry using my own loader for collada that
I have some problems animating a loaded COLLADA Model. I've written my own parser
I'm preparing to write a COLLADA importer in Java. There aren't any pre-written importers,
I wrote an app to automatically connect to our different Firewalls. All of them
I wrote a grid helper (GridHelper.cs), it works right for all models. This Helper
I wrote a code that pick all the pixels with a specific color from
I wrote a simple jquery slider that basically goes through 3 divs, hidding one
I wrote a program in c# now I would like to know what is
Wrote a simple program that calls ls, then passes each line through regexp filtering
Wrote a script in bash. Now im need to bring information into a text

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.