Login Action Required

The NinevehGL Forum uses a new concept of "socialized forum" or as we like to say "Tweet Forum".

Here is the deal:
  1. No new registration is required. Just sign in with your Twitter account and authorize the NinevehGL Forum.
  2. Once you’re in, you'll be able to "Follow a Thread", that means every time that thread receive a new post or update you'll receive a mention on your twitter.
  3. Besides, you can enable "Auto Share", then every new post and/or thread you make will be tweeted on your timeline. (By default, auto-share is enabled only for your threads)

Forum Rules:

1. We understand human comunication can become "hot" sometimes. So some insults and bad words ARE allowed. Just don't push too much being an asshole all the time.

2. SPAMMERS are not allowed. There are penalties for this kind of user and they can be banned forever.

3. You can report other users, if you judge necessary. An user reported many times by many people can also be banned forever. However you can also receive penalties for report deliberately for no apparent reason.

If there is a similar thread title, make sure the other one doesn't already have the answer you're looking for.

This forum uses the BBCode (Bulletin Board Code), here are some instructions:

Bold: [b]text[/b]
Italic: [i]text[/i]
Underline: [u]text[/u]

Code: [code]text[/code]

[ul] [*]item [/ul]
[ol] [*]item [/ol]



Embed (videos, code, 3D):

Welcome to the NinevehGL's world!
NinevehGL is a 3D engine forged with pure Obj-C.
Welcome to the
Hello, Guest.

Your current vote:

You can change your vote many times. But it's still one single vote.

Progress Blocks for NGLMesh Loading
Vote this thread:


Posts: 41


Mon, Jun 11 2012

One useful feature I tend to employ in my own loading sequences is the inclusion of progress blocks that get called every time a major progress update is made. For example, I use another SDK that has to do with downloading images from my server. This SDK employs a method that allows you to provide both a completion block and a progress block for the download, Ex:

The class is called a "PFFile" and the method to get it's data is done by calling it's get data in background method like so:

PFFile *myFile;
[myFile getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {

} progressBlock:^(int percentDone) {


I was thinking it would be a great feature to have in NinevehGL for mesh loading, like so;

NGLMesh *myMesh = [[NGLMesh alloc] initWithFile:@"myFile" settings:nil delegate:self inBackgroundWithBlock:^(NGLMesh *finalMesh, NSError *error) {

} progressBlock:^(int percentDone) {


In this way, we don't even require the delegate methods at all and we get the added benefit of being able to perform actions on the mesh AS it is loaded. A perfect example would be loading a level for a game comprised of many NGLMeshs. We could simply do something like this:

//Example array containing all of the paths for each NGLMesh in the current level
NSMutableArray *levelMeshs = [[NSMutableArray alloc] init];
[levelMeshs addObject: @"skybox"];
[levelMeshs addObject: @"raceTrack"];
[levelMeshs addObject: @"terrain"];
[levelMeshs addObject: @"building01"];
[levelMeshs addObject: @"building02"];

NGLCamera *camera = [[NGLCamera alloc] init];

UIProgressView *progressBar = [[UIProgressView alloc] init];

int totalMeshsLoaded = 0;

for (NSString *meshPath in levelMeshs) {

NGLMesh *myMesh = [[NGLMesh alloc] initWithFile:meshPath settings:nil delegate:self inBackgroundWithBlock:^(NGLMesh *finalMesh, NSError *error) {

totalMeshsLoaded ;
[camera addMesh: finalMesh];

if (totalMeshsLoaded > [levelMeshs count]) {

//All meshs are loaded, start game


} progressBlock:^(int percentDone) {

//Increase the progress so the user knows something is happening
progressBar.progress = percentDone / [levelMeshs count];



This is just pseudo code but you get the idea. It makes it very easy to wrap everything up into a clean package instead of relying on the delegate methods for mesh loading. Just an idea I think would be very useful. If you dont like it, no worries ;).

- Adam Eisfeld
0% like this - 0/0


Posts: 41


Mon, Jun 11 2012

In response to: @adameisfeld

For some reason my post had every occurance of PlusEquals (in symbol form) removed. So I had totalMeshsLoaded plusEquals 1, progress plusEquals ..., etc.

Strange that the Twitter API removes this combination of symbols.
0% like this - 0/0


Posts: 571


Tue, Jun 12 2012

In response to: @adameisfeld

Hello Adam,

Yes, we already have plans to create a full blocks system. Just like the Cocoa does.
However this is not our priority, since we have plans to port NinevehGL to other platforms like WebGL and Android.

And blocks are something very specific to Objective-C.

0% like this - 0/0

NinevehGL is a 3D engine built right on top of OpenGL ES and it uses all the programmable pipeline power, making it easy for you to create great application with shaders.

Share on

Follow NinevehGL
Fastest way to contact us:

Copyright © 2011 db-in. All rights reserved.