NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
December 17, 2017, 10:58:47 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Youe can not help men permanently by doing for them what they could and should do for themselves. ..."Abraham Lincoln(1809-1865, US President 1861-1865"
Google Bookmarks Yahoo My Web MSN Live Netscape Del.icio.us FURL Stumble Upon Delirious Ask FaceBook

Pages: [1]   Go Down
  Print  
Author Topic: how to make a slider time t that allows user to slide to replay simulation  (Read 8000 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
on: September 22, 2008, 12:14:45 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

how to make a slider time t that allows user to slide to replay simulation

is there any easy way to implement a slider bar t that will allow scrolling back in time like a movie player control for any simulation?

i notice in http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=188.msg2817#new

in slider property
variable = ts
enabled = _isPaused
on drag = dragt()

under model custom
public void dragt () {
 PY1[2]=v1s=v10+a1*ts;
 PY2[2]=v2s=v20+a2*ts;
 x1s=x10+v10*ts+a1*ts*ts/2;
 x2s=x20+v20*ts+a2*ts*ts/2;
 PT[2]=PT[3]=ts;
}

this appears to be a way you designed to control the playback controller due to known equations of motion under constant acceleration.

Is there a easy way to do a playback controller for time t for any simulation that it just played ?
i was hoping maybe some library java may have it Grin

thanks!

Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #1 on: September 22, 2008, 02:12:08 pm » posted from:Taipei,T'ai-pei,Taiwan

I used the equation because this is a simple case and I know the equation.
For all general type of simulations, what you need to do is make dt become negative value and you can reverse the time.
You can add code to ask the program to stop at any point you want.
So you can change direction of time when you program the simulation - You are the GOD of your simulation - you can do whatever you want with your simulation : You just need to figure a way to do it! (It is how we use our mind to make it work -- this is more important than always depend on library from others.)
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #2 on: September 22, 2008, 02:36:43 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

For all general type of simulations, what you need to do is make dt become negative value and you can reverse the time.
You can add code to ask the program to stop at any point you want.
So you can change direction of time when you program the simulation - You are the GOD of your simulation - you can do whatever you want with your simulation : You just need to figure a way to do it! (It is how we use our mind to make it work -- this is more important than always depend on library from others.)


wow! that is a good idea for making the simulation run back in time.

but the logic is the same for silder bar ?.....hmmmmm i need to think.


Logged
Pages: [1]   Go Up
  Print  
Youe can not help men permanently by doing for them what they could and should do for themselves. ..."Abraham Lincoln(1809-1865, US President 1861-1865"
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
how to make the text b always appear after the simulation is reset?
Dynamics
lookang 16 15663 Last post July 26, 2007, 11:40:25 pm
by Fu-Kwun Hwang
how to make slider with fixed values for instance 1,2,5,10 50
Questions related to EJS
Fred Chuit 2 7242 Last post January 20, 2009, 09:23:48 am
by lookang
how to make a slider remember previous value after reset simulation.
Questions related to EJS
lookang 2 6107 Last post January 20, 2009, 01:37:25 pm
by lookang
How make applet run one time only/board:23-100-
Question related to Physics or physics related simulation
ahmedibrahim 4 4515 Last post July 17, 2010, 12:35:45 am
by ahmedelshfie
How to make gravitational simulation ?
Physlet builder (Create your own simulation)
GwenArBreizhou 22 55518 Last post May 06, 2015, 12:49:02 pm
by lookang
Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.051 seconds with 22 queries.since 2011/06/15