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.

Problem with adding subview
Vote this thread:


@Momeks

Posts: 71

NGLSpecialist

Sun, Jul 15 2012


Hi , I am using AR example , I have created a UIView with Interface builder , but when I try to add it to the subview nothing happens !!!!! even a label


- (void) viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

[self.view addSubview:_infoView];
}t

0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Sun, Jul 15 2012


In response to: @Momeks

Hello buddy,

Yes, this will not work because the OpenGL graphics layer is made when the view becomes visible, not when the view is loaded. That means if you add a view before the view appears, this view will be under the OpenGL layer.
0% like this - 0/0

@Momeks

Posts: 71

NGLSpecialist

Tue, Jul 17 2012


In response to: @dineybomfim

so what is the solution ? is there any code ? to add on the layer ?
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Wed, Jul 18 2012


In response to: @Momeks

Well, just as any other Cocoa class that extends UIView, it's not advisable to use it to insert children.

For example, an UIImageView should be used exclusive to handle UIImages, not to place your custom views. At the same way, let the NGLView exclusive for 3D content. Because if you make a global change this could recreate the OpenGL buffers, which will override any subview in the NGLView as well.

As in Cocoa, you should:

UIView
|
|-- UIImageView
| |
| |-- UIImage
|
|-- UIView (my custom view)

UIView
|
|-- NGLView
| |
| |-- 3D content
|
|-- UIView (my custom view)
100% like this - 1/1

@Momeks

Posts: 71

NGLSpecialist

Wed, Jul 18 2012


In response to: @dineybomfim

Sorry I don't get it ! , I faced with several problem !

1- I have a background image (UIImageView) in xib view , When I add this image to the view _mesh will be hide behind this image !!
there is no way the _mesh (3D Object) become subView !

2- and in AR sample code when Camera captures the data image and for example the 3D objects did appeared , i can not send any view to subview ! for example , when user touch the object a view should be appear on camera , but nothing happens

[self.view addSubView: infoView]; !!!
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Wed, Jul 18 2012


In response to: @Momeks

OK buddy,

This is becoming more about iOS subject than 3D.
Let me show you, better than explain:



Notice that all the special views are siblings between them, not parent nor child.
By following this good practice you will manage and organize your views much easier.



At the same way you don't directly add children to UIWebView, UITableView, UIImageView... you should don't put subviews inside NGLView, because all those views are special kind of UIView. If you place a custom view inside one of those views you can interfere in the natural process of those classes and the most probable is that your custom view will be ignored by the internal processes.

So what should you do?

Just as the image shows, you have one great parent view (which is a simple UIView) and this one receives all the other special kinds of views, generating your final layout:

100% like this - 1/1

Fri, Mar 1 2013


In response to: @dineybomfim

Hi, I have a similar issue. I thought you explained that very good but I am still having some problems:
I am using storyboard and I selected my viewController
and I added a new View and some other UIElements (Label, TableView) on the same level:


ViewController:
View
View (named it mainARView)
Label
TableView
...

These are all subview of my View (or not?) so I have to add them as Subview to View
like so:
[self.view addSubview:_mainARView];

but where? in viewDidAppear or earlier? (loadView, didLoad?)

I also assigned the nglView to the mainARView and used it bounds for the correct size.
But this resolves in an memory error.

What did I do wrong.
0% like this - 0/0

Tue, Mar 12 2013


In response to: @derpruem

Hi, to potential readers.
I just want to complete my last words. (in forums it happens a lot that people tell others about an error or issue they had, but when they solved it, no solution was offered. So I want to add my for the issue I described in my lines - maybe someone else has a similar problem)

I solved my issues (getting memory alloc, bad access, AR Init Error....)
One reason was that I totally messed up some code snippets: mixed programmatically view editing and storyboard view controller behavior.

When done via storyboard really no extra window or subview assigning is needed and don't forget to load "super" in appropriate view methods. (When using IB with a Nib/Xib or Storyboard with Nineveh an Vuforia not calling super in loadView will crash the application and Vuforia will give you an error (Application initialisation failed). Well in the code samples : "Following the UIKit specifications, this method should not call the super." is written. Either way, call there super or just copy NinevehGL and Qualcomm related stuff in "viewDidLoad" method - Storyboard will do the rest, just assign there your UIView (where you want your ninevehGL content) as NGLView.
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.