NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
November 23, 2017, 04:36:51 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  
"Vision, mission and action." ...Wisdom
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 use the memory of Trace component  (Read 5023 times)
0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
Fred Chuit
Newbie
*
Offline Offline

Posts: 18



«
Embed this message
on: October 10, 2009, 03:43:17 am » posted from:Steinsel,Luxembourg,Luxembourg

Dear Ejs-users,

I would like to have graphs where the previous lines are redrawn (or stay vissible) on restart (_play) of the animation.
So a graph will show new plotted and previous lines.
Could any one please explain how to do that?
How to use the memory options of the trace component?
Already thanks for any help or advice.
Regards,
Fred
Logged
lookang
Hero Member
*****
Offline Offline

Posts: 1784


http://weelookang.blogspot.com


WWW
«
Embed this message
Reply #1 on: October 10, 2009, 08:18:32 am »

Try to have a button called action _initialize()
so the applet still think it is running the simulation, thus continue to draw as t increases.

_Reset() button really reset the simulation to original state so that is not the button to use.
 
Logged
Fu-Kwun Hwang
Administrator
Hero Member
*****
Offline Offline

Posts: 3080



WWW
«
Embed this message
Reply #2 on: October 10, 2009, 08:42:32 am » posted from:Taipei,T\'ai-pei,Taiwan

Suggestion for using "trace" GUI element:
1. Set Max Points to a fixed number:  for example: I normally define npt=300, then assign Max Points=npt , otherwise it will record all data points (it possible to use all computer memory).
2. set "Memory" to 3 will keep the last 3 trace triggered by _initialize() . i.e. when _initialize() is execute a new trace is drawn.
3. If "Mem Color" is assigned and different from "Line color" , previous traces will change color to Mem Color.
Logged
Fred Chuit
Newbie
*
Offline Offline

Posts: 18



«
Embed this message
Reply #3 on: October 10, 2009, 08:35:13 pm » posted from:Steinsel,Luxembourg,Luxembourg

Dear prof. Fu-Kwun Hwang and mr. lookang,

Your information helped me to fix the problem I had with the graph.
Many thanks for your help.
Regards,
Fred
Logged
Pages: [1]   Go Up
  Print  
"Vision, mission and action." ...Wisdom
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
It is fun to play with prism. (light trace and intensity due to refraction)
Optics
Fu-Kwun Hwang 2 29122 Last post July 25, 2012, 08:23:38 am
by Fu-Kwun Hwang
How to make the trace in a plot to clear after _initialize()
Questions related to EJS
lookang 3 6702 Last post February 16, 2009, 05:16:07 pm
by Fu-Kwun Hwang
Lesson 2: How to add trace x-t/ vx-t
EJS tutorial (How to create simulation with EJS)
Fu-Kwun Hwang 0 7478 Last post March 16, 2009, 09:59:53 pm
by Fu-Kwun Hwang
Adding Ghost Trace images
Question related to Physics or physics related simulation
mickey2times 10 14902 Last post September 26, 2010, 11:16:55 am
by DonaSima
How to add diffrent positions to trace in satellite motioin applet
Questions related to EJS
ahmedelshfie 23 18617 Last post October 21, 2011, 10:34:25 pm
by ahmedelshfie
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.064 seconds with 22 queries.since 2011/06/15