Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Frog

Pages: [1] 2 3
1
Lua / Re: Physics engine 3.2
« on: July 01, 2012, 06:25:58 am »
Jim, thanks for the code! Although I haven't had the time to go through it yet, a quick glance gave me a better idea as to how you should draw the items. I expected a function in Chipmunk to loop through everything, but I guess you should just create separate objects for everything, like you've done...

It really helps a lot! :)

2
Lua / Re: Physics engine 3.2
« on: June 29, 2012, 03:58:00 pm »
@jimbauwens: Indeed, it's way more complex than I expected! Even just some working source code would help me out a lot, I think I can figure out from that how it works. And maybe I could then also help you with a tutorial? :)

@Lionel: Mmm, maybe I should then just use plain-old Lua then... On the other hand, isn't it true that all the calculations made by the physics engine are faster than anything you can do in Lua, since it's backed by native code?

3
Lua / Physics engine 3.2
« on: June 29, 2012, 03:23:42 pm »
Hi everyone,

It's been some time since I last checked Omnimaga (although I've never been an active member), but now that I'm finished with my exams I finally have the time to program a calculator game again. And now I noticed that OS 3.2 has been released! I really want to try the Physics engine, because I'm thinking of making a game utilizing it, but I don't really know how to start.

I saw the video of the physics engine, but couldn't find the source code for it. Also, TI's documentation is pretty sparse. I assumed you didn't need to initialize the engine like you normally should, and I've been able to add a space, a body, and a shape. But how do I draw this? I guess you should somehow loop over all shapes and draw them in the positions the engine tells you to, but how do I do this? Or is there a better way? I can't find it in the reference...

On a side note: is using this physics engine overkill for a simple platforming game?

4
Lua / Re: Toolpalette not working properly
« on: April 30, 2012, 01:16:12 pm »
How come I never think of something like that? Although it does feel a bit hacky, it works the way it should. But why didn't TI just add a Lua command graph.refresh() or something like that? Anyways, thanks a bunch!  :)

5
Lua / Re: Toolpalette not working properly
« on: April 30, 2012, 12:41:29 pm »
Well, that doesn't work either. If I change the variable using math.eval(), it isn't updated in the graph view. No matter whether I use a slider or a function. The only thing that does happen, is that changing a slider value updates the graph. Maybe I can use that to make it slightly easier...

Anyways, thanks for the help!

6
Lua / Re: Toolpalette not working properly
« on: April 29, 2012, 03:15:03 pm »
Jim: Great that it has been improved! I tried to use it once, but I couldn't do anything with it. Do you have any clue as to when 3.2 will be released?

In my document I've got one graph tab and one lua tab. In the latter you can create new shapes by parameters in a nice GUI, so for a circle you have to enter parameters a, b and r for example. This data is then used to create a function (or actually two functions, because it's otherwise impossible) that the stock TI graph window can display. These two functions together make up the desired shape.

Since there is no way to add new functions to a graph tab using lua, I've create 20 functions that are all set to 0/0. This means they will be showed when they are set to something else, but will not be displayed until that happens. I then set 2 of these functions to the two functions that I created using the data in lua. What I meant is that there is no way to make this change visible in the graph tab using lua; the graph is only updated when a variable is set in a calculator window or a function is added in the graph tab. The users of my applications have to do that manually, which is not really handy. This must be something that is required quite often? ???

I hope I've made myself clear, since it's quite hard to describe. Do you happen to know a way to do this which I haven't thought of? I need this, because there is no way to display circles, hyperbola's, etc. by parameter in the TI graph window... :-X

Btw, Loulou, your animated signature strangely enough caused both my computer and my iPad to lag... ;)

7
Lua / Re: Toolpalette not working properly
« on: April 29, 2012, 11:12:10 am »
That fixed the problem, but it sure is really strange behavior... The more I use the TI Lua API, the more I get the feeling that it is stitched together by some bad tape. For example the D2Editor, or the fact that there is no way to update a graph tab from a Lua tab (a big problem in this app, you have to manually update the graph); it's all weird behavior. Still it's of course better than TI-Basic...

Anyways, thanks a lot for your help! :)

8
Lua / Toolpalette not working properly
« on: April 28, 2012, 03:57:56 pm »
Hi everyone. It's been some time since I last did something in Lua for the TI-NSpire, but I recently made a script for a school project. It basically uses the default NSpire graph window to draw shapes (circles, hyperbola's, etc.) by parameters. It works great. However, the toolpalette doesn't show when clicking the menu-key, unless you have first opened the calculator using the shortcut. This only happens on the calculator, not in the TI simulator. Really strange behavior, isn't it? I have the following code in my on.create function:

Code: [Select]
menu = {
{"Add",
{"Circle", showForm},
{"Ellipse", showForm},
{"Hyperbola", showForm},
{"Parabola", showForm}
}
}
toolpalette.register(menu)

Am I doing something wrong, or is it just a bug in the OS software?

Thanks!

9
Lua / Re: Prettify string (superscript etc.)
« on: October 01, 2011, 02:23:07 pm »
@Jim: No problem, I also forgot about it myself. :P

I figured the same, I think I'll have to do that.

10
Lua / Re: Prettify string (superscript etc.)
« on: October 01, 2011, 10:37:56 am »
Man, I just realized I didn't reply to this post! Sorry!

@Loulou: Yeah, I already realized that. I changed that in my code as well.

@jimbauwens: Have you already thought of a way to do that? I've been thinking about it as well, and the only method I can think of is a manual draw method... Do you agree with me?

Thanks for all the answers!

11
Lua / Re: Prettify string (superscript etc.)
« on: September 24, 2011, 04:17:57 pm »
Mmm, I have another problem. :P In my problem users can enter a string and I calculate the derivative. The problem is it's quite hard to read, so I decided to make powers in superscript. I now have all numbers in superscript, but I can't find a way to do this for alphabetic characters. I also looked at the UTF-16 specification (which the TI-NSpire uses I believe), and those characters don't exist! How can I do this? Or do I have to manually draw the powers in a smaller font?!

12
Lua / Re: Prettify string (superscript etc.)
« on: September 23, 2011, 04:46:10 pm »
Man, that's really quite hard. Thanks a lot again!

13
Lua / Prettify string (superscript etc.)
« on: September 23, 2011, 02:02:15 pm »
I'm trying to prettify a string, so that for example ^2 becomes 2 and sqrt(x) becomes the true square root sign. How can I do this in Lua? I've been trying to find out the correct codes using string.byte(), but somehow superscript 1 to 3 all return 194. And when I try to insert that character using string.char(194) I get a lot of strange signs. How can I do this?

Thanks!

14
Lua / Re: Add function to the gc class
« on: September 10, 2011, 02:40:19 pm »
Wow, this works great! Thanks a lot, adriweb!

15
Lua / Re: Add function to the gc class
« on: September 09, 2011, 02:45:00 pm »
Yeah, it would be great if you put it on inspired-lue!

I can't use the cmd, because I'm using a mac. I didn't find a way to run the TI-Nspire software from the terminal, or are you talking about the third-party emulator for windows?

Pages: [1] 2 3