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.

Tweening with a boolean (?)
Vote this thread:


@evanbuxton

Posts: 3

NGLNewbie

Fri, Jun 22 2012


Hello,

I am using Adam Eisfelds' touch library and require the following: A stack of individual blocks in a 3 x 3 matrix. Touching any of the blocks will push it forward (out of the matrix). Touch it again, or any other block and it will go back to its old position.

So my question is - what is the best way to pass the correct mesh tapped a tween, and then if tapped again a different tween? My thought was a boolean - check if it is 'out' and move back else move out.

Eventually I will be passing a message that this particular box was tapped so show something over 'here' but that is another forum post.

Thank you for any asisstance - I don't think it matters that I am using Adams library - but I could be wrong. I just want to know how you would go about tracking tweens based on location/movement or selection. In your example code everything just animates when the view loads. I want to control the animation based on taps.


- (void)didTapAEGLMesh: (AEGLMesh*)tappedMesh
{

tappedMesh.mesh.material = materialHit;
[tappedMesh.mesh compileCoreMesh];

if ([lastTappedMesh isEqual:box1]) {
lastTappedMesh = boxx1;
} else if ([lastTappedMesh isEqual:box2]) {
lastTappedMesh = boxx2;
}


NSDictionary *tween;
tween = [NSDictionary dictionaryWithObjectsAndKeys:
kNGLTweenRepeatMirrorEase, kNGLTweenKeyRepeat,
@"2.0",kNGLTweenKeyRepeatDelay,
@"-0.5", @"x",
@"0.3", @"y",
nil];

[NGLTween tweenWithTarget:lastTappedMesh duration:1.0 values:tween];

tween = [NSDictionary dictionaryWithObjectsAndKeys:
kNGLTweenRepeatMirrorEase, kNGLTweenKeyRepeat,
@"2.0",kNGLTweenKeyDelay,
@"2.0",kNGLTweenKeyRepeatDelay,
@"0.5", @"x",
@"0.3", @"y",
nil];
[NGLTween tweenWithTarget:lastTappedMesh duration:1.0 values:tween];

tween = [NSDictionary dictionaryWithObjectsAndKeys:
kNGLEaseLinear, kNGLTweenKeyEase,
kNGLTweenRepeatLoop, kNGLTweenKeyRepeat,
@"360.0", @"rotateY",
nil];
[NGLTween tweenWithTarget:lastTappedMesh duration:20.0 values:tween];
}
0% like this - 0/0

@dineybomfim

Posts: 571

NGLAdmin

Sat, Jun 23 2012


In response to: @evanbuxton

Hi buddy,

I don't know if I understand what you're trying to do. But independent of the code you made, here is some features about NGLTween:

  1. Use NGLTweenDelegate to be notified about the tween states. Like "willRepeat" or "didRepeat"
  2. A BOOL is in fact 0 and 1, so you can tween a float 0-1 transforming it into a BOOL again.

Here is the tween docs:
http://nineveh.gl/docs/Protocols/NGLTweenDelegate.html

Cheers,
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.