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.

Touching and order in NGLGroup3D
Vote this thread:

Sat, Jul 7 2012

For some reason the order in which I place meshes into NGLGroup3D and then into the camera affects which ones I can touch or not. The positioning is such that mesh1 covers mesh2 half way. In the code below if I swap the two lines where I add meshes into the group, then one mesh will not be touchable unless the other mesh moves out of the way. If I swap back then I can touch both meshes one after another.

In the image below the grey square is mesh1, and the surrounding maze is mesh2 which overlaps it. Both are on the same z-axis. How can it be that the order in which I enter them into the NGLGroup3D affects touching?


group3d = [[NGLGroup3D alloc] init];

mesh1 = [[NGLMesh alloc] initWithFile:@"mesh1.obj" settings:settings delegate:nil];
mesh2 = [[NGLMesh alloc] initWithFile:@"mesh2.obj" settings:settings delegate:nil];

mesh1.tag = 1;
mesh2.tag = 2;

mesh1.touchable = YES; // swapping these lines makes one mesh touchable and
mesh2.touchable = YES; // and the other not, otherwise both are touchable

[group3d addObject:mesh1];
[group3d addObject:mesh2];

_camera = [[NGLCamera alloc] init];
[_camera addMeshesFromGroup3D:group3d];

0% like this - 0/0

Sat, Jul 7 2012

Sorry that should be

mesh1.touchable = YES;
mesh2.touchable = YES;

[group3d addObject:mesh1]; // swapping these makes one mesh touchable and
[group3d addObject:mesh2]; // and the other not, otherwise both are touchable

0% like this - 0/0

Sat, Jul 7 2012

I removed the NGLGroup3D and init the camera with meshes directly; same result. I tried varying the z of one of the meshes to bring it closer or farther but still the same result. The order of meshes I init the camera with affects which one are touchable.

0% like this - 0/0


Posts: 571


Sat, Jul 7 2012

In response to: @Maxicatten

Hello buddy,

What touch routine are you using? Do you have an intermediated sent by NinevehGL team?

NinevehGL doesn't have the full touch API yet, this maybe is why you're having troubles. But I'll make sure this is not a possible issue with the new touch API.
0% like this - 0/0

Sun, Jul 8 2012

Hi, I'm using touchingUnderPoint. I emailed about a different issue with flicker on material change but got a reply that while that's fixed new binaries are not sent out yet until they are stable.

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

UITouch * t = [[touches allObjects] objectAtIndex:0];

CGPoint p = [t locationInView:self.view];

NGLTouching touching = [myCamera touchingUnderPoint:CGPointMake(p.x, p.y)];

NSLog(@"Mesh: %d", touching.mesh.tag);

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.