Better, but a point keeps jumping graphics window

dkuhlmann shared this question 10 years ago
Answered

I have attached two files, which do the same thing. They are modeling the "Mad Tea Cup" ride at Disneyland. I want to show a point moving as the riders would and also have the option to Trace the point. I did this by defining Y and Y' the same way and when the Text "Show Traces" is selected, a script runs which sets Y' visible in Graphics. Y always shows but does not trace, Y' traces when it is set visible. Both Y and Y' have been declared in Graphics but not in Graphics2. However, whenever I open it, all is good except Y' appears on in Graphics2, is visible and Traces. Y remains in Graphics only. I cannot figure out why this happens.


I have a work around (the file ending in wa) that turns off Y' in Graphics2 when "Turn Animation On" or "Show Traces" is selected. So while this is not an immediate problem, it is one of those annoying irritants. If you look at the code, I have defined togTr=0 to start and the script has togTr=1-togTr so TogTr is either 0 or 1. Hence in the work around togTr==2 will always be false.


Thanks.

https://ggbm.at/550395

https://ggbm.at/550397

Comments (4)

photo
1

Not sure if this is a bug yet (are you redefining Y' in a script anywhere?), but a better solution would be to have a boolean 'trace' which you use in the Condition to Show of Y', then your button can just do SetValue[trace, !trace]


If you wait for the next release then you will be able to just do:

trace = !trace

photo
1

Not understanding the syntax of SetValue[trace,!trace] I get the gist but not sure what it is really doing. Would this turn on all objects that have trace selected?

photo
1

Hi, this would hide (=> stop tracing) all objects that have "trace" as their Condition to Show Object (Properties > Advanced).

photo
1

If this command works the way described, I would still have the same problem. Y' would be tracing in Graphics2 instead of Graphics. The problem remains that Y' has been declared in Graphics but when the file is opened it is Graphics2.

© 2022 International GeoGebra Institute