Complex animation?!?
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Complex animation?!? Expand / Collapse
Author
Message
Posted 7/23/2008 2:18:41 PM
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Group: Forum Members
Last Login: 11/18/2008 2:12:05 PM
Posts: 10, Visits: 44
Here's the setup I have so far...
___________________________
l.....................................l
l...............................................l
l...............................................l
l...............................................l
l...............................................l
l.......................o......................l
l...............................................l
l...........................................l
l___________________________l

A slide image - triangular image setup like the one above (except not smiley faces) - the "o" represents a solid circle image...

What i need is the circle to start at the bottom image and move up to either corner image BUT if the circle is heading to one direction and receives a signal it is to change directions toward the opposite image....

Can I do this with ePrime?...I plan on having the signal come from and external program analyzing fMRI data....What would the inline Script require?

If there is something that needs to be further explained please ask and i will reply as promptly as possible...This has to be solved before this new study can begin...

Thank You for any and all help....
Post #1867
Posted 7/24/2008 4:24:18 PM


Forum Member

Forum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum MemberForum Member

Group: Forum Members
Last Login: 10/9/2008 4:26:59 PM
Posts: 33, Visits: 149
This would require a bit of coding.

If you haven't already, take a look at the sprite animation sample hosted in the support section. It will give you an idea of how to use an off screen canvas to store the next frame, and then copy it to the display for animation.

For your "complex animation" you would need to write either inline code or a subroutine that does the following in a loop:

- Check what the target object should be (check the input device history for the signal)
- Determine the distance between the circle, and its current target destination (I might make this a separate subroutine)
- Using a (preset) duration value, determine how far (x and y) the circle must travel each frame (refresh rate of the monitor) to get there in time (distance/time for both x and y)
- update the position of the circle (in a subroutine very similar to the sprite animation example)
- copy all the static objects to an off screen canvas
- copy the circle (in its new position) to the off screen canvas
- wait for a vertical screen refresh
- copy the off screen canvas to the canvas being displayed
- check for the end (reached the target, or time is up, etc.)
Post #1876
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 6:44pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 10 queries. Compression Disabled.