Author Topic: [Lua] Make3D  (Read 40358 times)

0 Members and 1 Guest are viewing this topic.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #90 on: August 12, 2011, 08:46:37 am »
I think that there is a confusion with "motor" and "engine". In French, both are translated into "moteur" but "motor" is more for cars.
« Last Edit: August 12, 2011, 08:54:19 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #91 on: August 12, 2011, 08:50:57 am »
Ah, didn't noticed that, thanks!

Zbuffer needs a array, which size is [height*width], okay
I need a array, whiich's size is 3*numVertices, okay...

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #92 on: August 12, 2011, 09:03:06 am »
How the motor works? I dunno how directly adpat these engine in C...

Yeah ... that's the problem ...
The 'How it works' is a too large question.

I work with two tables : points and faces.
points is basicly a table which contains successively X, Y and Z coordinates (i.e : points = {x1, y1, z1, x2, y2, z2, ...)
faces is a table of tables. Each of theses table contains numbers (2, 3 or 4). Those numbers refer to the point position in the points table.

With this information I'm abale to do what ever I want. After, it is a mathematical problem.
« Last Edit: September 21, 2011, 01:38:33 pm by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Eiyeron

  • Urist McEiyolobster
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1430
  • Rating: +130/-10
  • (-_(//));
    • View Profile
    • Rétro-Actif : Rétro/Prog/Blog
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #93 on: August 12, 2011, 09:10:21 am »
Ah the 2nd table refers every time to the vertices who're composing the faces. I could use structures...

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #94 on: September 13, 2011, 05:40:16 pm »
Ok, back to work, at school I have many huge projects to do in a short amount of time so I guess make3D will slow down a little bit.

But during the past 2 days I've been working on something I couldn't believe it was possible, but in fact, the TI-Nspire Lua API .. well ... the TI-Nspire Framework in general has a real potential.

First, you have to keep in mind that I previously worked on a possible way for Make3D to be modular, like Blender, I mean, with multiple widgets all synchronised and fully customizable. This technique has a problem : each time you duplicate the widget, you duplicate the source code. Thus, we have to find a way to avoid this useless duplicated data which is the same all the time.

What I'd been working on, is importing, through strings, Make3D source code from MyLib. Indeed, this is possible !
It is possible, yes, but, I have to use a modified version of makeTNS for making it working which is not compatible with OSes 3.0.2 and sup. Why ? Because The source code isn't saved between <wdgt type="TI.ScriptApp"></wdgt> but in the symbol table in the beginning of Problem1.xml, the area where all variables of a problem are defined. Ok then, I just save the source code as a string variable, but keep in mind that tns documents are crypted and we don't know how to crypt it, and if we knew it we won't be in rights to reproduce it (legal issues). Luna uses the legal fact that TI can't crypt user's source code, thus, it is "clear" in the zipped archive.

So my modified version of MakeTNS only opens a xml file in the Problem1.xml format, and save it as a tns document only compatible with OS 3.0.1 - just resave it with OS 3.0.1 to make it compatible with newer OSes.
Here it is : http://levak.free.fr/ftp/nspire/Make3D/maketnsFromXML.py

Then, I made my proper "Makefile" that generates in a different way my Library file that has the entire Source Code as multiple public strings : http://levak.free.fr/ftp/nspire/Make3D/Makefile.sh

You will be able to see that it also generates a widget with the "include" method which loads and launches all strings from the library. It handles "basic" errors on start-up like if we didn't refresh libraries before launching the widget.

It keeps the save and restore states but it is a little bit of bullshit, welll, it is a little bit strange, but it works :D

The Makefile source code also includes my really-quick-coded-TI.Notepad-converter-from-text that converts a text in a valid xml widget - But as I said, it is impossible for now to launch it with an OS like 3.0.2 or higher.


Finally, the url changed since it is a little bit different (compatible 3.0.1, 3.0.2, 3.1):
  • Make3D_debug - when working without library
  • Make3D_lib - when working with library link. The redistribuable widget is included (only copy and paste it in a new document)

That way Make3D will act like a "viewer". When sharing a model, you won't share Make3D source code with it, only the "importer" script.


PS : I'm really tired I can't take the time to see any grammatical-syntax error, my bad ...
« Last Edit: September 13, 2011, 05:46:27 pm by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #95 on: September 13, 2011, 05:50:17 pm »
Great job ;-)
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline ExtendeD

  • CoT Emeritus
  • LV8 Addict (Next: 1000)
  • *
  • Posts: 825
  • Rating: +167/-2
    • View Profile
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #96 on: September 14, 2011, 03:59:00 am »
Nice idea :)
Also I can try to provide any information needed to port the converters to OS 3.0.2 and above.
« Last Edit: September 14, 2011, 04:00:21 am by ExtendeD »
Ndless.me with the finest TI-Nspire programs

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #97 on: September 14, 2011, 04:58:03 am »
Indeed, very good job :)
And, this idea will be useful for many other programs :)

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: [TI-Nspire] Make3D - TI-Basic to Lua
« Reply #98 on: September 14, 2011, 07:49:17 am »
Thanks =)

Here are some screenshots :



Nice idea :)
Also I can try to provide any information needed to port the converters to OS 3.0.2 and above.
In public or in private ?
Because when I wanted to modify Luna to do this, I was stopped by Lionel Debroux's explanations about how it finally works. Are you able to convert an xml file (like Problem1.xml) in a tns document ? Because if we can do that you can quickly understand that it is possible to make an alternate version of TI Nspire Computer Software compatible with Linux.

Indeed we can easily document the xml syntax used in Problem1.xml by dumping TI Nspire computer Software clipboard, since it saves it in readable data.
« Last Edit: September 14, 2011, 07:50:30 am by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: [Lua] Make3D
« Reply #99 on: September 14, 2011, 08:15:11 am »
Wow. awesome!
btw, in the screenshot, is that "nom" on purpose or is it different language?
Sig wipe!

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: [Lua] Make3D
« Reply #100 on: September 14, 2011, 08:17:48 am »
Wow. awesome!
btw, in the screenshot, is that "nom" on purpose or is it different language?

It is in French yeah =')
Translate them by "Name" and "Size"
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: [Lua] Make3D
« Reply #101 on: September 14, 2011, 08:18:20 am »
oh, ok. XP
Sig wipe!

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: [Lua] Make3D
« Reply #102 on: September 27, 2011, 05:02:23 pm »



 - no more infinite points behind the virtual camera (no camera yet, but it should come)
 - transparent mode
 - object label is displayed in every modes
 - Some invisible micro-features like  Shift+Z to switch backward in display modes (Z lets you switch forward)

What "should" be there in the future
 *- real camera that enables you to really move in 3D space
 *- Grid ?
 *- adding objects like cubes, cylinders etc ...
 *- edit mode that let you play with vertex and faces
 ***-> it requires a lot of features in face manipulations (recalculate normals outside, flip normals, syncronisations of mesh based datas, etc ...)
 *- selection by cursor
 ***-> it requires a simple raytracer function (I've done that before but it involves huuuge formulas ...)
 ***-> I'm certainly kidding, or mad, but ... it could go in another way :D A RayTracer on the Nspire ? :DDD


Bonus :

« Last Edit: September 27, 2011, 05:03:56 pm by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: [Lua] Make3D
« Reply #103 on: September 27, 2011, 05:06:07 pm »
These are some sweet screenshots!  Keep up the good work!

Offline Chockosta

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 447
  • Rating: +169/-6
    • View Profile
Re: [Lua] Make3D
« Reply #104 on: September 28, 2011, 07:31:55 am »
Really nice !
Edit mode would be great, but kinda hard...
Good luck with that !