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.

AVCaptureVideoPreviewLayer and NGLView/Vuforia problems
Vote this thread:


@pwhitlock

Posts: 12

NGLNewbie

Wed, Mar 27 2013


I am trying to use AVCaptureVideoPreviewLayer and NGLView to display interactive 3d models in one view controller and in another view controller use vuforia to present a target AR view. The problem is that if I view the interactive model in one view, then close it, and open the AR view I get no camera background. Just the blue background from NGLView shows. The AR works properly, tracks model perfectly, but no camera background. Has anyone run into anything like this that could have some insight? The amazing @dineybomfim? Any thoughts as to what i'm doing wrong here?
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Thu, Mar 28 2013


In response to: @pwhitlock

Hello buddy,

Let me check if I got your point...
You're doing everything on the same view? Or each one has one separated view?

NGLView is one thing. Any other QuartzLayer (it means almost all other Layer types) can't be done in the same NGLView, this is why it's a separated view class. To do so you must create another UIView and use the layer there.

The Vuforia is one AR engine that perfect integrates with NinevehGL because its render is done via OpenGL and can be shown in the same NGLView, without using any alpha features nor creating other views.

If you choose the separating the views all that you need now is to:

  1. Bring NGLView to top front.
  2. Activate the alpha channel (by default it's turned off in NinevehGL, click here to see how ).
  3. Change the NGLView background color to [UIColor clearColor].
0% like this - 0/0

@pwhitlock

Posts: 12

NGLNewbie

Thu, Mar 28 2013


In response to: @dineybomfim

Each one has a separate view. Example, modelViewController, and ARViewController. The issue is that if I open my modelViewController to interact with the model, then close it, and switch to the ARViewController, I don't see the camera feed. As I said, the model shows correctly when the track image is acquired, I just don't see the camera feed.

I followed your suggestions like so

[self.view bringSubviewToFront:nglView];
nglView.backgroundColor=[UIColor clearColor];
nglGlobalColorFormat(NGLColorFormatRGBA);
nglGlobalFlush();

and now I get a black background on the AR view but still no camera. I get no initialization errors from Vuforia. Everything works exactly as it should, with the exception of the camera feed not being visible. I am using the code almost exactly as it appears in the vuforia sample for my AR View. If I start the app from first build, and I open ARViewController first, it works perfectly, its only happening after I have opened my modelViewController, then try to go back to the ARViewController.

Just for further info, my modelViewController is set up as the AVCaptureSession, with the NGLView added as a subview. Also i'm using ARC and on closing the window i'm closing my capture session and setting all of my camera view layers to nil. If that helps you understand what i'm doing there.
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Thu, Mar 28 2013


In response to: @pwhitlock

OK,

So it will not work at this way or without a workaround.

This is what goes inside this integration: NinevehGL creates a EAGLContext and shares it at main thread level. Vuforia takes this context and uses it. When you leave the NGLView it will try to clean up that context, wich causes Vuforia not being rendered.

Of course the Vuforia algorithm will still working, because it has nothing to do with OpenGL, it's calculated based on AVFoundation inputs.

You can try to destruct all the Vuforia objects and start then over when you go to your view again, but not sure if this will work.

Now that you know why this happen you can try another solutions.
0% like this - 0/0

@pwhitlock

Posts: 12

NGLNewbie

Thu, Mar 28 2013


In response to: @dineybomfim

That's what I was afraid you were gonna say. Maybe I can hack my modelView to use vuforia by taking out the AR parts? I will have to go back and rethink how I want this all to work together. Thanks again for all of your hard work on this engine and for the great help you give to the community!
0% like this - 0/0

@VicktorManuel

Posts: 1

NGLNewbie

Tue, Jan 5 2016


In response to: @pwhitlock

hey, do u have a example bro?
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.