Geogebra 3D

157 views
Skip to first unread message

Dean Ang Gmail

unread,
Sep 10, 2023, 10:38:44 AM9/10/23
to Numbas Users
Hi,
Can Numbas geogebra extension support loading of a geogebra applet from a geogebra 3d file, like this one:

Thank you.

Christian Lawson-Perfect

unread,
Sep 12, 2023, 10:15:27 AM9/12/23
to numbas...@googlegroups.com
Yes, 3D works the same as any other kind of GeoGebra applet.
It looks like GeoGebra does some automatic resizing based on the size of the viewport instead of the size of the element it's embedded in, so on my desktop that applet gets clipped with a scrollbar, but on a narrower display it looks OK. I'll have to look into that to see if there's anything we can do to avoid it.

--
You received this message because you are subscribed to the Google Groups "Numbas Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to numbas-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/numbas-users/a26710cc-8b1d-41a8-a7c4-e5e5793489d6n%40googlegroups.com.

Dean Ang Gmail

unread,
Feb 6, 2024, 8:38:56 AM2/6/24
to Numbas Users
Dear all,

What I meant to ask previously was: Does NUMBAS support 3d geogebra loaded from a ggb file? It sure doesn't look so from my end. 
Thank you and have a nice day.

William Haynes

unread,
Feb 6, 2024, 11:46:40 AM2/6/24
to Numbas Users

I think you will need to use an extension function to change the applet perspective to the 3d Graphics view.   geogebra_file()  seems to default to Graphics1 perspective.

app.promise.then(function(d) {
  d.app.setPerspective('T');
});
return new Numbas.jme.types.ggbapplet(app);


The available perspective codes are here  https://wiki.geogebra.org/en/SetPerspective_Command

Will

Dean Ang Gmail

unread,
Feb 7, 2024, 3:32:06 AM2/7/24
to Numbas Users
Thanks for the help but this is a bit beyond me even though I can code. Can I have a little more explanation how I create this "extension function"?

William Haynes

unread,
Feb 7, 2024, 11:21:57 AM2/7/24
to 'guillaume theo' via Numbas Users
Sure,

Go to the "extensions and scripts" tab, and then to "functions".  Add a function, give it a name, and set its language to javascript.  Add a parameter called "app" with type "ggbapplet" and paste in the code below.  Call this function inside curly brackets to show the diagram.    See this example: 


The code snippet below is basically boilerplate.   You can add other commands to do other things as needed.   The Geogebra API commands you can send to geogebra are described here:

Will


Dean Ang Gmail

unread,
Feb 9, 2024, 1:35:08 AM2/9/24
to Numbas Users
Thank you! It works.

But I have another problem that is bugging for a while now.
I have changed the question.css file in the theme folder so that I can fit the output of the question container into a reveal slides.
However, the content, I think with id prompt or prompt display, continues to be of limited width.
That defeats the purpose of changing the container width.
Does anyone know which element I can modify to change to the look I want and where to find the css file.

Thank you and have a nice day.

regards,
Dean
Screenshot 2024-02-09 at 1.45.47 PM.png

Reply all
Reply to author
Forward
0 new messages