Author Topic: Using libraries like nGL with micropython  (Read 3469 times)

0 Members and 1 Guest are viewing this topic.

Offline Malcolm Forde

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +0/-0
    • View Profile
Using libraries like nGL with micropython
« 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?

Offline Ivoah

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +3/-0
    • View Profile
    • Codinghobbit
Re: Using libraries like nGL with micropython
« Reply #1 on: April 18, 2015, 11:59:13 pm »
There is a simple graphics library for micropython, look at the demo that comes with it.
http://codinghobbit.no-ip.org
My Calcs:
TI-86 (now broken) $2
TI SR-56 - $0
TI-Nspire CX CAS - $152
TI-84+ Silver Edition - $56
TI-84+ Silver Edition - $0
TI-85 - $0
TI-73 Explorer VS - $10
ViewScreen - $3

Offline Malcolm Forde

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +0/-0
    • View Profile
Re: Using libraries like nGL with micropython
« Reply #2 on: April 19, 2015, 12:39:05 am »
Thanks!

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: Using libraries like nGL with micropython
« Reply #3 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.

Offline Malcolm Forde

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 8
  • Rating: +0/-0
    • View Profile
Re: Using libraries like nGL with micropython
« Reply #4 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.