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 Storyboard & NineveyGL : image background behind NGLView
Vote this thread:


@laurentcabon

Posts: 2

NGLNewbie

Thu, Jul 26 2012


Hello !

I currently trying to set a background image of a NGLView for example display a cube with an image behind. For now, I can only display a color but it would take a picture and that's where it gets stuck ..

My hierarchy of view is that in my Storyboard:

View Controller
      - NGLView
                  - Button UIKit

 
And my job

- (Void) viewDidLoad
{
/ / Must call to super Agree With the UIKit rules.
[Super viewDidLoad];
    
    self.view.multipleTouchEnabled = YES;
/ / Setting the loading process parameters. To take advantage of the NGL Binary feature,
/ / Remove the line "kNGLMeshOriginalYes, kNGLMeshKeyOriginal". Your mesh loaded Will Be 950% faster.
NSDictionary * settings = [NSDictionary dictionaryWithObjectsAndKeys:
kNGLMeshCentralizeYes, kNGLMeshKeyCentralize,
@ "0.15", kNGLMeshKeyNormalize,
nil];

    / / Allocate the cube
_cube1 = [[NGLMesh alloc] initWithFile: @ "dice_ver2.obj" settings: settings delegate: nil];

    _cube1.tag = 1;
    
    / / Allocate the camera
_camera = [[NGLCamera alloc] initWithMeshes: _cube1, nil];
    [_camera AutoAdjustAspectRatio: YES animated: YES];
    
   _cube1.x = -0.8;
_cube1.y = 0.0;

    _cube1.rotationSpace = NGLRotationSpaceWorld;
    _cube1.rotationOrder = NGLRotationOrderYZX;
    
    / / Starts the debug monitor.
[[NGLDebug debugMonitor] startWithView: (NGLView *) self.view];
    
    nglGlobalFPS (30);
    / / NglGlobalAntialias (NGLAntialias4X);
}


I hope you can help me because I've tried everything and it does not work ..

Regards,

L. (from France)
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Thu, Jul 26 2012


In response to: @laurentcabon

Hello buddy,

Seems you can find your answer here:
http://nineveh.gl/community/forum/problem_with_adding_subview

0% like this - 0/0

@laurentcabon

Posts: 2

NGLNewbie

Mon, Jul 30 2012


In response to: @dineybomfim

Hey,

Thank you for your reply but I still have the same problem (loading an image background behind a cube..). I tried to set up a subview but the cube is no longer displayed. I also tried to set up a mesh for the image to resolve the problem but it still does not work. Can you help me again?
http://nineveh.gl/resources/general_contact_button.png
Why is it possible to put a color in the background, not an image?
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Mon, Jul 30 2012


In response to: @laurentcabon

Hello buddy,

So, send your project via contact email and we'll tell you what is going on with your code.

The question about color VS image is simple: NinevehGL, just as with Cocoa, doesn't accept image as background, just colors... it's a concern about the how the core graphics works.

Thinking the way as core graphics works, setting a simple color is just a question of an uniform value, however setting an image involves many concerns about pixels, sizes, colors frames and bounds. All this related work generated a new class... the image view classes.

So to set a background image is easier creating a simple UIImageView and place it behind an UIView... exactly as you should do with NinevehGL.
0% like this - 0/0

@yang5664

Posts: 16

NGLNewbie

Mon, Mar 17 2014


In response to: @laurentcabon

====Draw Image in NGLView background with nglContextEAGL===

-(void)updateScreen{
NSURL * testImageURL = [[NSBundle mainBundle] URLForResource:@"04997" withExtension:@"jpg"];
NSAssert(nil != testImageURL, @"Image not found");

CIImage * image = [CIImage imageWithContentsOfURL:testImageURL];

//Declare CIContext
if (self.ciContext==nil) {
self.ciContext = [CIContext
contextWithEAGLContext:nglContextEAGL()//<=bind nglView contextEAGl
options: @{kCIContextWorkingColorSpace:[NSNull null]} ];
}
[self.ciContext drawImage:image inRect:self.nglView.bounds
fromRect:[image extent]];
}
///drawView

- (void) drawView
{
if (_isReady)
{
// Render video background and retrieve tracking state
QCAR::State state = QCAR::Renderer::getInstance().begin();
QCAR::Renderer::getInstance().drawVideoBackground();
[self updateScreen];
.....................
}
}

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.