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]
Quote:
[quote=@username]text[/quote]
[quote]text[/quote]

List:
[ul] [*]item [/ul]
[ol] [*]item [/ol]

URL:
[url]http://url.com[/url]
[url=http://url.com]text[/url]

Image:
[img]http://imageurl.com[/img]

Embed (videos, code, 3D):
[embed]http://url.com[/embed]

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

Your current vote:

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

Initializing Meshes
Vote this thread:


@iamchait

Posts: 1

NGLNewbie

Sat, Jun 9 2012


Hey,
I was trying to load 3D files from Documents directory of my app in ipad. But NinevehGL does not seem to accept any files outside Resources directory .

Is there a way to change the default directory from which ninevehGL loads 3D files?

Pls help..





0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Sat, Jun 9 2012


In response to: @iamchait

Well, you're aware about the Global Path and the NinevehGL Path API, right?

If not, here is a small explanation:
Any path or file in NinevehGL goes through the NinevehGL Path API. This API controls the files flow in the local system path.
There are three possibilities:
- Absolute Path: When informing a full system paths or a specific bundle path, it will be taken as literaly, so NinevehGL will use your path as it is.
- Relative Path: When informing a relative paths or when there is no file in the informed Absolute Path, NinevehGL will assume it's a relative path and will start to search in the Global Path.
- File's Name: When informing the only file's name, NinevehGL will search that file in the Global Path.

Another important thing to understand is how NinevehGL deals with related files. Related files will always be searched in the same folder. For example, if your 3D file has 2 textures, that textures will be searched in the same folder as the 3D files. If you're using another folder to textures, which is not usual, you'll must to set the each texture manually. There is no control over this feature, because there are a lot of related files types: textures, mtl, rta, pvr, shl, vsh, fsh and other hundreds possibilities.

Now about the Global Path, it's a single path used by NinevehGL Path API. You can change the global path using the Global API:

nglGlobalFilePath(@"my/new/system/path");


By default, the Global Path is set to the main bundle.


There are more information on our docs and tutos, like this:
http://nineveh.gl/docs/Classes/NGLMesh.html#//api/name/initWithFile:settings:delegate:


Hope this helps you to understand how the paths works in NinevehGL.


In case you still with doubts, here is the code to access the Documents folder:

// iOS routine to retrieve the correct path to the documents folder.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documents = [paths objectAtIndex:0];

// Appending an optional folder and the file's name.
NSString *filePath = [documents stringByAppendingPathComponent:@"Dragons/Red Dragon.dae"];

mesh = [[NGLMesh alloc] initWithFile:filePath settings:settings delegate:self];


As we told you, you can create any folder structure you want. But remember that the textures of "Red Dragon" (in this example) must lies inside the "Dragons" folder, because the NinevehGL will search related files in the same folder as the original file.

Cheers,
0% like this - 0/0

@Khaled_Mahmoud1

Posts: 16

NGLNewbie

Sun, Jul 29 2012


In response to: @dineybomfim

Dear Mr.dineybomfim
I tried to do this:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *fullpath = [documentsDirectory stringByAppendingString:@"carMER.obj"];
_mountain = [[NGLMesh alloc] initWithFile:fullpath settings:settings delegate:self];

but it still not work for me

what's the problem???
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Sun, Jul 29 2012


In response to: @Khaled_Mahmoud1

Hey buddy,

I'm not Mr... call me Bro, please.

So, in this case, send us an email with your project. We can take a look and find the problem in it.
0% like this - 0/0

@helebje

Posts: 12

NGLNewbie

Sat, Jun 1 2013


In response to: @dineybomfim

Visting this thread. Regarding placing the textures in the same folder: Just to help someone like myself, if you happen to copy your Collada into the Docs folder and wonder what to with the texture exported from Sketchup, as I dont know how to export from Sketchup into the same folder. This is what I do:

Export my files normally.

mymodel.dae
mymodel/texture.png

Then edit mymodel.dae in TextEdit and remove the folder ref from the xml and copy my texture.png into the same place mymodel.dae within my Resources, from there then copy them onto the Docs folder in the same place. Very simple but was not sure if it worked, it does work!

Then I can replace my texture.png with any camera image or anything else I want, such as a map screen shot!

H

0% like this - 0/0

@blackened5

Posts: 8

NGLNewbie

Fri, Oct 11 2013


In response to: @helebje

Hi Guys,

I'm unsure about a similar issue.

I would like to be able to open a COLLADA file with a NinevehGL based app. I was trying to email the file to myself, then open it with my new app. I'm hoping it just works... my question is about whether that's the right way to do it?
0% like this - 0/0

@blackened5

Posts: 8

NGLNewbie

Fri, Oct 11 2013


In response to: @blackened5

More specifically, I was hoping for something that allows the user to choose the file from a template or view from a list.

Any help clarifying this with a code example would be great.
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Fri, Oct 11 2013


In response to: @blackened5

Maybe, you're trying to achive the same as those published apps:

http://nineveh.gl/community/forum/magicspace
http://nineveh.gl/community/forum/three_dimensional_model_viewer

So, yes, it's possible.
0% like this - 0/0

@blackened5

Posts: 8

NGLNewbie

Fri, Oct 11 2013


In response to: @dineybomfim

I didn't get it working yet, but I know this block of code is part of it.

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{

if (url != nil && [url isFileURL]) {

// xdxf file type handling

if ([[url pathExtension] isEqualToString:@"dae"]) {

NSLog(@"URL:%@", [url absoluteString]);

}

}

return YES;
}

0% like this - 0/0

@blackened5

Posts: 8

NGLNewbie

Fri, Oct 11 2013


In response to: @blackened5

Got that from The Stack. What it does is when you open a file through an email attachment, it puts your app in the choices...
0% like this - 0/0

@blackened5

Posts: 8

NGLNewbie

Fri, Nov 1 2013


In response to: @iamchait

Hey Guys,

I wanted to bump this… I still can't get my app to open from the sandbox… can anyone give me some code?

0% like this - 0/0

@blackened5

Posts: 8

NGLNewbie

Fri, Nov 1 2013


In response to: @blackened5

I am trying to get my app to view COLLADA files that are sent via email… I want my app to show up as a choice when the file is opened.

I know this framework can make this happen… but I do not know how. Can someone chime in?
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Sun, Nov 3 2013


In response to: @blackened5

Hello buddy,

Not exactly. The NinevehGL it self does not handle with URL connection nor any related stuff. Taking the file from URL, email or any place is up to you.

Once you have the file properly saved inside your app sandbox (that means, the Library folder, Documents folder or any other path inside the local directory) you can inform the NinevehGL about your file's local path and it will load it for you.
0% like this - 0/0

@rafafirenze

Posts: 4

NGLNewbie

Sun, Nov 15 2015


I'm still having the same problem.

I added my .obj (and .mtl) to the mainBundle,

then I try to load it as:
_mesh = [[NGLMesh alloc] initWithFile:@"myObject.obj" settings:settings delegate:nil];

and I can't see anything.

I've tried also as:
NSString *myobj = [[NSBundle mainBundle] pathForResource:@"myObject" ofType:@"obj"];
_mesh = [[NGLMesh alloc] initWithFile:myobj settings:settings delegate:nil];

and also I can't see it

What am I doing wrong?
0% like this - 0/0
Technology

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.