Omnimaga

Calculator Community => TI Calculators => General Calculator Help => Topic started by: Malcolm Forde on April 18, 2015, 10:03:07 pm

Title: Using libraries like nGL with micropython
Post by: Malcolm Forde on April 18, 2015, 10:03:07 pm
Is it possible to do this on the TI Nspire CX? Or will I have to learn C/C++ to do anything graphical on my calculator?
Title: Re: Using libraries like nGL with micropython
Post by: Ivoah on April 18, 2015, 11:59:13 pm
There is a simple graphics library for micropython, look at the demo that comes with it.
Title: Re: Using libraries like nGL with micropython
Post by: Malcolm Forde on April 19, 2015, 12:39:05 am
Thanks!
Title: Re: Using libraries like nGL with micropython
Post by: Vogtinator on April 20, 2015, 05:20:58 am
I actually thought about writing an interface to use nGL from within Micropython, but in the end it'll be too slow.
I would have to implement a new data type (GLFix, fixed point) that is not supported by python directly, using floats wouldn't be fast enough.
It would definitely work, but it won't be fun.

Anyway, I designed nGL in a way that makes it fairly easy to use, without any complex language constructs.
Knowledge of C should be enough (although the files have to be C++) to get a decent nGL app running.
Also, to just do some basic 2D graphics I'd recommend looking at other libs which aren't optimized for "heavy" 3D graphics like SDL or n2Dlib.
Title: Re: Using libraries like nGL with micropython
Post by: Malcolm Forde on April 20, 2015, 07:59:00 am
I was considering attempting to learn C again just for programming on the TI-Nspire. And I probably will since compiled C code is a whole lot faster than any compiled language. I've done a fair bit of javascript and a tiny bit of C already, so learning C for this purpose shouldn't be all that hard.