Author Message

<  extend  ~  ofxTweener proposal

PostPosted: Tue Mar 03, 2009 9:59 am
Joined: Mon Mar 02, 2009 8:55 pmPosts: 6Location: Germany
Hello all,

I'm currently starting my first project with OF. I've been working with actionscript a lot and miss a convenient tweening tool in OF. I've seen there has been an attempt to create a tweener, but I think one could do better. I was thinking of looking at some of the ideas that the Tweenlite library for AS3 offers. A call to the tweener could look something like this:

ofxTweener::to ( [tms time in ms], [ptw pointer to tweening function], [pf pointer to float], [f float] );

This call would tween the float which the pointer pf is pointing to to the new value the float f defines in tms milliseconds using the ptw tweening function. I guess one would have to call an update function in the ofxTweener class from the main update routine so that the tweener could work this way.

I've been reading about an event system to be integrated into of sometime soon, I think that would probably work really well together with my proposed ofxTweener.

My actual question is, would anybody apreciate me putting work into the ofxTweener class, and does my proposed functionality make sense to everyone?

Thanks,

Dave



_________________
http://huesforalice.com
Offline Profile
PostPosted: Tue Mar 03, 2009 10:51 am
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1807Location: brooklyn
sure ! sounds useful and it makes sense... Have you seen this tweening code:

http://code.google.com/p/cppglue

from erik sjodin ? it might be just what you are asking about or a good starting point:

http://code.google.com/p/cppglue/source ... on/Tween.h

- z


Offline Profile
PostPosted: Tue Mar 10, 2009 4:30 pm
User avatarJoined: Mon Apr 28, 2008 11:18 pmPosts: 20
Hope I'm not to late :)

I second this... it would be really nice to have a simple tweening library similar to how AS3 has Tweener or Tweenlite. However to work similar to Flash using the poco events in 0.0.6 would be best to target the specific object, Also ofxInteractiveObject might be a good library to look at.

Some functions Tweenlite has build in would be really useful such as function proxies and delayed function calls etc.



_________________
www.nuiman.com
Offline Profile
PostPosted: Tue Mar 10, 2009 4:35 pm
Site AdminJoined: Wed Apr 11, 2007 1:02 amPosts: 1192Location: barcelona
Hey

sometime ago i adapted erik's code to be more openframeworks style, you can download it here:

http://65.111.166.199/openframeworks/ofxTween.zip

but i think it has some events in it based in the event system in 5.7xx so i'll try to change it to make it more 006. but if you want to take a look...


Offline Profile
PostPosted: Mon Jun 22, 2009 2:41 pm
Joined: Mon Jun 02, 2008 8:24 pmPosts: 409Location: Kiel - Germany
Hey arturo,

I was wondering if you changed the event system to 006?

Thank you :)


Offline Profile
PostPosted: Mon Jun 22, 2009 10:54 pm
Site AdminJoined: Wed Apr 11, 2007 1:02 amPosts: 1192Location: barcelona
yes, indeed i've been working with it lately, has made it also easier to use but need to polish it a bit and put an example. will upload tomorrow.


Offline Profile
PostPosted: Fri Jun 26, 2009 2:12 pm
Joined: Mon Jun 02, 2008 8:24 pmPosts: 409Location: Kiel - Germany
sorry arturo for bothering again, but I would love to use the tweener addon for a multitouch project for university right now and it's pretty urgant in terms of time so I was wondering if you are done with it or could upload the unpolished version :)

thank you very much!


Offline Profile
PostPosted: Fri Jun 26, 2009 6:28 pm
Site AdminJoined: Wed Apr 11, 2007 1:02 amPosts: 1192Location: barcelona
oh sorry! totally forgot... going to pack it and upload.

EDIT: there it is :)
Attachments:
ofxTween.zip [14.42 KiB]
Downloaded 174 times

Offline Profile
PostPosted: Mon Jun 29, 2009 3:08 pm
Joined: Wed Aug 06, 2008 5:53 pmPosts: 158Location: Amsterdam
hi arturo, great work! oF rules again!!

Maybe you can upload your addon to google code?



_________________
http://www.roxlu.com
http://www.openframeworks.info
Offline Profile
PostPosted: Sun Sep 20, 2009 7:27 pm
Site AdminJoined: Fri Mar 02, 2007 9:06 amPosts: 444Location: London
arturo wrote:
oh sorry! totally forgot... going to pack it and upload.

EDIT: there it is :)


Hey Arturo

I'm trying to build in codeblocks windows and i get the following build errors:

Quote:
C:\openframeworks\v0.06\addons\ofxTween\src\ofxTween.h|59|error: `uint' does not name a type|
C:\openframeworks\v0.06\addons\ofxTween\src\ofxTween.h|60|error: `uint' has not been declared|
C:\openframeworks\v0.06\addons\ofxTween\src\ofxTween.h|60|error: ISO C++ forbids declaration of `duration' with no type|
C:\openframeworks\v0.06\addons\ofxTween\src\ofxTween.cpp|87|error: variable or field `setDuration' declared void|
C:\openframeworks\v0.06\addons\ofxTween\src\ofxTween.cpp|87|error: `int ofxTween::setDuration' is not a static member of `class ofxTween'|
C:\openframeworks\v0.06\addons\ofxTween\src\ofxTween.cpp|87|error: `uint' was not declared in this scope|
C:\openframeworks\v0.06\addons\ofxTween\src\ofxTween.cpp|87|error: expected `,' or `;' before '{' token|
C:\openframeworks\v0.06\addons\ofxTween\src\ofxTween.cpp|91|error: `uint' does not name a type|


seems it doesn't like uint



_________________
http://www.chrisoshea.org
Offline Profile
PostPosted: Mon Sep 21, 2009 4:26 pm
Site AdminJoined: Wed Apr 11, 2007 1:02 amPosts: 1192Location: barcelona
hey

yes uint is a typedef or something like that, that doesn't exist in windows. just substitute all of them with unsigned. will change it and re-upload as soon as i have time.


Offline Profile
PostPosted: Mon Sep 21, 2009 5:59 pm
Site AdminJoined: Fri Mar 02, 2007 9:06 amPosts: 444Location: London
do you mean instead of
uint getDuration();

do
unsigned in getDuration();

?



_________________
http://www.chrisoshea.org
Offline Profile
PostPosted: Mon Sep 21, 2009 11:52 pm
Site AdminJoined: Wed Apr 11, 2007 1:02 amPosts: 1192Location: barcelona
yes, instead of:

uint getDuration();

unsigned getDuration();

unsigned is actually the same as unsigned int.


Offline Profile
PostPosted: Sat Sep 26, 2009 5:07 am
User avatarJoined: Sat Jul 18, 2009 9:15 amPosts: 14Location: Melbourne
Hey arturo,

Thanks a lot for this class
coming from a Flash background I'm going to find it very useful

cheers,

Sam



_________________
http://www.future-primitive.net
Offline Profile
PostPosted: Mon Sep 28, 2009 2:18 am
User avatarJoined: Fri Mar 02, 2007 12:13 amPosts: 122Location: Montreal
Hi Arturo,

I'm currently using ofxTween. It's really helpful.
I had some problems using it, but I found a simple solution.

I think that the boolean 'running' should be initialized at false in the constructor of the class ofxTween.

Code:
ofxTween::ofxTween(){
   duration = 0;
   completed = true;
   running = false;
   easingFunction = NULL;

   from = 0;
   to = 0;
   pTarget = 0;
   easing = NULL;
   id = -1;
}


Hugues.


Offline Profile

Display posts from previous:  Sort by:

All times are UTC
Page 1 of 2
16 posts
Go to page 1, 2  Next
Users browsing this forum: No registered users and 1 guest
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron