Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Image reflection

Return to the EJS Modeling forum
Login to post to this thread

want to reflect a 2D image - Nov 25, 2012 at 8:05AM
Javier Mas
5 Posts

Hello I need some help. I have added a rocket as a 2D image inside a Plotting Panel. The rocket moves along the x axis in the positive direction with some variable speed v. A soon as the velocity turns negative I would like the rocket image to flip so as to point always in the direction of movement.
I have tried with the transformation editor in the Transform element of the popup panel. In it I see an item called Matrix Transf. It is a 2*3 matrix and I have not been able to  make it work.
I guess at some point I would need to insert a -1 for a reflection in the y axis, in the form Math.signum(v) or so. Can somebody help me?. Thanks a lot.


Current Replies - View all
Re: want to reflect a 2D ...   (Francisco Esquembre - Nov 26 2012 at 3:46PM)
The OSP Network:
Open Source Physics - Tracker - EJS Modeling
Physlet Physics
Physlet Quantum Physics