Problem: controlling the visibility of xOyPlane

Robert T. shared this problem 1 year ago
New

Geogbra classic 5:


Situation: In my applet I want the xy-plane of the 3D-view to start without the xy-plane.

Problem: After using the javascript command ggbApplet.setVisible("xOyPlane", false) the xy-Plane disappears correctly, but after that it cannot be made visible by using the context menu. I MUST use javascript to make it visible again with the command ggbApplet.setVisible("xOyPlane", true).


Is there a way to hide the xy-plane in javascript or Geogebra script without disabling the context menu ability to switch the xy-plane's visibility on again?

I tried ggbApplet.evalCommand("SetVisibleInView(xOyPlane,-1,true)") as well, but it seems to have no effect at all.

Comments (7)

photo
1

try with ggb script in a buttom


setvisible(xOyPlane,-1,a)

setvalue(a,¬a)


being a a boolean


do not use the button of menu, it seems a supercommand. when you use the button of menu for hiding you must to use the button of menu for showing

PD: I think there is a bug. if you use the script button and the button of view menu GG shows two xOyPlanes each one controled with different button

photo
1

Thank you for your answer, but indeed my problem is that I want to use the menu for hiding and showing the xy-plane after starting the applet with a hidden xy-plane. Of course I could control the visiblity with a checkbox or a button, but actually I wanted to avoid it. Like you I was surprised about the two different xy-planes, and I fear it's a bug, too.

photo
photo
1

try saving the work with hided plane and use only the menu button for hiding/showing the plane (so simple)

photo
1

Regretfully it is not that simple. Of course that was the first thing I tried. It works properly in the Geogebra classic 5 desktop application, but not after uploading it to Geogebra tube. As soon as I test it online in an internet browser, the plane which should actually be hidden, is shown as if it was never hidden. I even tried to change the visibility state of the plane while being online and save it, but the result is the same: it seems as if the hidden state has never been saved. This is most propably a bug.


(By the way, this is the applet: https://www.geogebra.org/m/nxkdzded - hitting the "Graphik"-button in the upper right corner switches to the 3D-view, and I promise, I saved the applet with a hidden xy-plane!)

photo
photo
1

lo siento, me veo incapaz de seguir y entender tal cantidad de javascripts que se llaman unos a otros con tal red de llamadas internas

lo más que he podido conseguir con una instruccion en el botón grafik es lo que se ve en esta copia del trabajo en la ultima linea del script. no sé si debe haber alguna variable que controle la aparición del plano; pero, como digo yo soy incapaz de imaginarlo. espero que alguien con más habilidad para java que la mía pueda hacerlo

https://www.geogebra.org/m/jmtzmh3t

photo
1

Thank you for your efforts of trying to find a solution for my stupid problem! Of course I can live with it, if my applet starts with a visible xy-plane. I simply wondered if I'm missing something obvious.

In the meantime I created a simple testing applet: https://www.geogebra.org/m/mzwsesuk


And I found out: I was wrong with my guess that the online version of Geogebra classic would not save the xOy-planes visibility state! The problem is caused by the setPerspective-command: In the desktop version of Geogebra classic it has NO influence on the xOy-plane's visibility state, but in the online version it resets the xOy-plane's visibility state.


So there are two bugs which prevent a solution:


1) In the online version of Geogebra classic the command setPerspective("G/T") behaves different from the desktop version of Geogebra classic: It initializes the xOy-plane's visibility state, so the xy-plane is always initialized as visible. The idea to use a scripting command for hiding the xy-plane leads to the second bug:


2) Using a scripting command (no matter if Javascript or Geogebra scripting) to hide the xOy-plane causes the context menu to deny the ability of switching the xy-plane back on. In the online version of Geogebra classic you can see the influence of setVisible("xOyPlane", ...) on the checkmark in the context menu. Interesting: SetVisibleInView has NO influence on the check mark in the context menu. Oh, and in the online version hitting the buttons in a random order confuses Geogebra until the xOy-plane cannot be changed any more at all :)


There is a 3rd bug actually, but it has nothing to do with the above problem. It can be seen in the desktop version of Geogebra classic only:


3) There seem to be two different xOy-planes. You can see that in my test-applet:


setVisible("xOyPlane", true) enables the first one


SetVisibleInView(xOyPlane,-1,true) enables ANOTHER xOy-plane!

photo
photo
1

pienso que GG no guarda la configuración de las ventanas que están no visibles en el momento de guardar el archivo, así que creo que la solución es guardar o compartir el archivo con todas las ventanas necesarias abiertas y en el inicio usar setPerspective() para dejar visibles las ventanas según cómo queramos verlas en realidad si queremos verlas de una forma que no sea la standar de inicio de GG

© 2020 International GeoGebra Institute