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.

How to render to a subview
Vote this thread:


Posts: 1


Thu, Aug 2 2012

Hi there,

is there any way to draw to a subview of self.view?

I have an existing app and i want to use 3d only on a specific single view in my app. And i already have a UIViewController with UIKit content. I added a subview to the rootview and only want to render in this specific subview and not to self.view of the view controller. As far as i have seen the demos and the tutorials seem to be very simple to set up, but they all rely on a full screen app with self.view as render view. I don't understand how the framework knows where to draw at?! I'm missing something like:

[whatever drawToView:self.view] (or in my case my subview).

Seems the rendering will always be done in self.view?! And in the demos, the meshes are just loaded without being added to ne nglview....seems that this also happens automatically?!

Would be nice if you could help me out with this.

Thx in advance


0% like this - 0/0


Posts: 571


Thu, Aug 2 2012

In response to: @Mexyn

Hello buddy,

In fact, everything you understood until here is wrong!

Please, don't huff me. Let me explain.

- NinevehGL has nothing to do with the ViewControllers, so there is no relation between the 3D content and the "self.view".
- Actually, one of my favorite parts of NinevehGL is that it's completely independent of everything in your application. You can create NGLMesh instances at anywhere, the NGLCamera can be allocated anywhere in your application, doesn't matter how many cameras or meshes you have. Nothing is bound in fact.
- All that you need is a single UIView... only a small place to put an instance of NGLView. Set the delegate for this NGLView and the magic happens. The 3D render will start and the delegate target will receive calls to "drawView" method.
- Remember the cameras and meshes? Inside the "drawView" method, any camera that receive a call to "drawCamera" will present its render on that NGLView. That's it!
- You can add meshes into a camera to make that camera render those meshes.

Here is an example of NinevehGL usage inside a very small view.
Just the 3D box at the bottom of this screen is a NGLView, everything else is a normal UIKit stuff.

Here are some concepts to remember:

  • NGLView is responsible to present a 3D layer, just it. Don't place other views or UI stuff inside it. Remember that even being a subclass of UIView and having frame and bounds, the NGLView is not responsible by the resulting 3D image, it has nothing to do with that.
  • The NGLCamera is the one responsible by the resulting image. How the image will looks like, its orientation, its aspect ratio and everything related to the look and feel of the resulting 3D. So it's very important to always set the "aspectRatio" property. By default, when you create a NGLCamera it will assume the aspectRatio of the full screen, however if you have NGLView with custom size, you must set the "aspectRatio", which is simply the result of a division of width/height of your custom view.
  • NGLMesh is responsible by the 3D content and its loading is, by default, made asynchronously.

That's it buddy, hope this helps you to get the spirit and logic of NinevehGL.
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.