Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: thydowulays on December 17, 2011, 05:22:13 pm

Title: Grapher
Post by: thydowulays on December 17, 2011, 05:22:13 pm
Hey everyone! So I have been hanging out at my friends house and *pwning* his calculator. For the past hour I have been working on a graphing program for geometry. So far I have a GUI, graphing with lines, intersecting lines, and rectangles. (Keep in mind this project is only an hour old) Anyway, it is completely flickerless and so far the only grayscale is behind the X button. I will regularly update this post with all the things I add, and I will ALWAYS post a screenie  :D. This is what I have planned for this project:

- Flickerless movement and point plotting (Done)
- GUI (Done)
- Slope display in the corner
- Much more options
- Gray grid lines behind the screen to make it look like a graph (Done)

Update 1 is out! Link: http://ourl.ca/14522/272130

Anyways, if you have any problems or suggestions, feel free to post them below. Thanks :)

Screenie:
(http://i43.tinypic.com/e6yfyg.gif)

Download link for source and executable below:
Title: Re: Grapher
Post by: saintrunner on December 17, 2011, 05:25:17 pm
go to modify then you can add it at the bottom of the screen where it says add attachments

By the way!!! WELCOME TO OMNI!! You should Introduce yourself
Title: Re: Grapher
Post by: thydowulays on December 17, 2011, 05:27:14 pm
go to modify then you can add it at the bottom of the screen where it says add attachments

By the way!!! WELCOME TO OMNI!! You should Introduce yourself

Thanks! I have introduced myself already. This website is pretty legit, so I'm going to be pretty active with all the projects I'm working on.
Title: Re: Grapher
Post by: saintrunner on December 17, 2011, 05:29:33 pm
sure thing! and Yeah, I really enjoy it, Oh (from experience) if you ever can't think of a project idea, you should check out the downloads section....The guys here are pretty hardcore and have some sweet games out!
Title: Re: Grapher
Post by: thydowulays on December 17, 2011, 05:31:49 pm
sure thing! and Yeah, I really enjoy it, Oh (from experience) if you ever can't think of a project idea, you should check out the downloads section....The guys here are pretty hardcore and have some sweet games out!

Yeah I've seen some amazing stuff out there..... I've also kept up with your Seeker project. It looks pretty amazing! I'm still experimenting with platformer games, but I'm much better at GUI apps and top-view based games.
Title: Re: Grapher
Post by: saintrunner on December 17, 2011, 05:33:45 pm
I need to work on GUI apps. I can make you a simple platformer source code, if your interested
Title: Re: Grapher
Post by: thydowulays on December 17, 2011, 05:35:35 pm
I need to work on GUI apps. I can make you a simple platformer source code, if your interested

I could help you with some GUI stuff :). The most advanced platformer I've made is one that uses unrealistic gravity and pxl-Test xD. But if you would like to help me with a platformer that would be nice as well :)
Title: Re: Grapher
Post by: saintrunner on December 17, 2011, 05:43:10 pm
Yeah, I'm still working on a more realistic gravity, as far as pxl-testing, I find that to be a pretty good way to go. But yeah, if you need help, just PM me (when you get enough posts lol)
Title: Re: Grapher
Post by: thydowulays on December 17, 2011, 05:47:29 pm
Yeah, I'm still working on a more realistic gravity, as far as pxl-testing, I find that to be a pretty good way to go. But yeah, if you need help, just PM me (when you get enough posts lol)

Okay, thanks. Well I have to go for now, but thanks :)
Title: Re: Grapher
Post by: saintrunner on December 17, 2011, 05:48:31 pm
ok, Oh and you don't have to quote me every post... Just so you know :)
Title: Re: Grapher
Post by: epic7 on December 17, 2011, 06:34:40 pm
:P

Yeah, I'm making a scrolling platformer.

Quote
The most advanced platformer I've made is one that uses unrealistic gravity and pxl-Test xD.
Having realistic gravity is really easy; you just need a few more variables.
But then once acceleration is fast, pixel testing gets a bit tricky. I'm figuring that out but I'm going to use leafiness0's strategy which is do a pixel test below the player and then keep moving up until it stops colliding.

For gravity, here's an example I made for saintrunner with some notes:
(saintrunner if you took that code, I made an error in that one. The guy won't fall O.O (this one is fixed (with y acceleration (which was -8 instead of 8 ))))

Jumping isnt really that bad.

[FFFFFFFFFFFFFFFF]->Pic1 ;Pic, but just a cube :P
56*256->Y ;X and Y are inflated by 256 for accuracy
0->X->V->W->A->B->J
Repeat getKey(15)
If getKey(54)
-256->W ;Set Y velocity to -256 to go up
256->V ;Set X velocity
8->B ;Set a downward acceleration to fall
End
If Y/256>57 ;simple collision with the bottom of screen
56*256->Y ;Reset
0->A->B->V->W
End
V+A->V+X->X ;Find X coordinates
W+B->W+Y->Y ;Find Y
Pt-On(X/256,Y/256,Pic1)
DispGraphClrDraw
End

Where X,Y are coordinates
V,W are velocities
A,B are accelerations

For this actual topic:
Looks cool. Imagine if for geometry someone made a two-collumn proof solver O.O
So this lets you draw lines and rectangles so far?
Title: Re: Grapher
Post by: thydowulays on December 17, 2011, 07:22:34 pm
Lol sorry saint, on most forum websites im on, people wont reply if you dont quote their posts. Thanks epic! Whoa, I didn't know there was a DispGraphClrDraw command. :O
Title: Re: Grapher
Post by: epic7 on December 17, 2011, 07:28:33 pm
From squidjetx's guide on optimizations, I've heard it does the same as
:DispGraph
:ClrDraw
But is twice as fast.
Title: Re: Grapher
Post by: Spyro543 on December 17, 2011, 08:21:15 pm
This is just scary. I made a geometry program called Grapher, except it's for the computer.
Title: Re: Grapher
Post by: thydowulays on December 17, 2011, 08:49:26 pm
lol nice. Can anyone help me with the gray lines that would make a grid? I have made a small program that displays gray lines, but i cant properly embed the concept in mine. The source is in the post. Could I have some help? Thanks :)
Title: Re: Grapher
Post by: chattahippie on December 17, 2011, 09:05:27 pm
From squidjetx's guide on optimizations, I've heard it does the same as
:DispGraph
:ClrDraw
But is twice as fast.
But it is also a larger command
Title: Re: Grapher
Post by: thydowulays on December 17, 2011, 10:09:22 pm
Update 1: (HUGE update)

This is my first update since the release. So many things have changed:

- Added snapped movement
- 8 pixel movement instead of 1 pixel
- Added 4 Quadrants
- Added Gray Grid Lines
- Removed support for mouse clicking options, made it the function keys
    This means that to change options, use F1, F2, F3, F4, and F5

There is still some stuff needed to do:
- Add slope in corner
- Add coordinates in corner
- Add math menu for geometric conversions

Screenie and new sources in the bottom!


Oh and lol, the NIGSRC and NIGTITS was my friend playing with his calc making programs xD
Title: Re: Grapher
Post by: epic7 on December 17, 2011, 10:29:33 pm
NIGTITS? O.O

Looks cool with those new gray lines!
Title: Re: Grapher
Post by: saintrunner on December 17, 2011, 11:16:33 pm
lookin really good :)
Title: Re: Grapher
Post by: thydowulays on December 17, 2011, 11:25:55 pm
Thanks! @epic7 LOL ikr i asked my friend what he was trying to accomplish with putting the NIGTITS program on both the real calc and wabbit and he said no comment. xD. But yeah I'm currently working on the coordinate system. I have it figured out but the origin (0,0) is in the top-left hand corner and I want it to be in the center. I also want it to be able to support negative numbers.....
Title: Re: Grapher
Post by: saintrunner on December 17, 2011, 11:29:06 pm
This is a long shot, but you could just set two variables to the coordinates of the middle of the screen, then sit down for five minutes and tell yourself repeatedly, that those variables equal 0,0.....lol
Title: Re: Grapher
Post by: thydowulays on December 18, 2011, 02:49:24 pm
Okay I need some of you guys to help me out.... I am trying to get a coordinate system up, but it isn't working PERFECTLY. It does put the origin at the point of intersection of the two x and y lines, but if I go below 0, instead of giving me -1, it gives me 8191. The formula I'm using to convert 8 pixels to 1 coordinate is:
X-45/8->G .Note that G is the coordinate in the program, not the pixel itself
Y-30/80>H .Note that H is the coordinate in the program, not the pixel itself

That will put the origin in the center. I used to use X/8->G and Y/8->H but that put the origin at the top left hand corner.
Anyway, so my negatives aren't working. I'll put a screenie up showing it better.....

Note that once I open up my graph program, the Y axis is flipped (when I go down, the number goes up instead of down, and it should be negative)
Also note that the number goes to 8191 once I go into the 1st, 2nd, and 4th quadrants
Title: Re: Grapher
Post by: saintrunner on December 18, 2011, 02:52:46 pm
I read somewhere that you have too use >> for negatives in axe....But I'm not sure
Title: Re: Grapher
Post by: calcdude84se on December 18, 2011, 03:07:09 pm
saintrunner has the gist of the issue. If you're trying to use negative numbers, you have to use the signed versions of Axe's operators (only applicable for division and comparison), which are formed by doubling up the unsigned version. In the case you've mentioned, you need to use // instead of /.
Title: Re: Grapher
Post by: saintrunner on December 18, 2011, 04:24:05 pm
Wow, I'm surprised, usually I'm wrong lol
Title: Re: Grapher
Post by: thydowulays on December 18, 2011, 08:03:23 pm
Wow, thanks! I was just about to make a huge ass subroutine that would make it negative lol


EDIT: Wait just a minute. For some reason, now it says 65535 instead of 8919 when I use //. If you see the screenshot above, In the first part I show the code that makes the coordinates at the origin. So I replaced the X-45/8->G with X-45//8->G but it still doesn't work.....  :banghead:
Title: Re: Grapher
Post by: calcdude84se on December 18, 2011, 08:19:06 pm
As far as Axe is concerned, 65535=-1 ;) The obvious solution is to test if G is less than 0, and, if so, display a negative sign and then -G.
Title: Re: Grapher
Post by: saintrunner on December 18, 2011, 08:20:57 pm
Wow...Always go for the 'KISS' method lol.... Keep It Simple Stupid :) That's what my Dad used to tell me all the time
Title: Re: Grapher
Post by: thydowulays on December 18, 2011, 08:22:29 pm
Thats what my subroutine was going to be...... erg why doesn't Axe support full negative numbers? Or at least include like a neg( function or something so I don't have to keep writing the subroutine..... lol but whatever I guess I'll get to it.
Title: Re: Grapher
Post by: saintrunner on December 18, 2011, 08:26:39 pm
you can suggest it to Quigibo
Title: Re: Grapher
Post by: thydowulays on December 18, 2011, 08:39:04 pm
I did indeed. Hmm.... I tried -Ans( and everything to get a negative number.......... I'm really trying to avoid writing the subroutine to do it for me..... there must be an easier way....
Title: Re: Grapher
Post by: saintrunner on December 18, 2011, 08:41:02 pm
As far as Axe is concerned, 65535=-1 ;) The obvious solution is to test if G is less than 0, and, if so, display a negative sign and then -G.

you try this? It doesn't sound to hard
Title: Re: Grapher
Post by: calcdude84se on December 18, 2011, 08:43:38 pm
I even wrote a routine that will do that (for the homescreen, but you can adapt it) as a response in the feature requests topic, but others had already posted. For reference, it would go something like this:
Lbl DSN
If r1<<0
Disp "-
End
Disp r1➤Dec
Return

Then you'd just replace "Disp X➤Dec" with "DSN(X)"
Something I'd like to reiterate: There is absolutely no difference between, say, 65535 and -1. Which way it is interpreted depends on the routine acting on it (for example, < vs <<)
Title: Re: Grapher
Post by: epic7 on December 18, 2011, 08:46:41 pm
I thought I remembered someone say that <<0 will only be true for 0. I guess i must be wrong :P.
Title: Re: Grapher
Post by: calcdude84se on December 18, 2011, 08:52:17 pm
More likely just misremembering. The closest statement to that that would be true is that X≤0 is only true if X is 0. :)
Title: Re: Grapher
Post by: thydowulays on December 18, 2011, 09:53:38 pm
Thanks guys. @saintrunner Yes I did try that...... @calcdude84se Thanks so much, that drastically sizes down the subroutine I was writing.
Title: Re: Grapher
Post by: saintrunner on December 18, 2011, 10:06:29 pm
Glad to hear it,  can't wait to see this when it's done
Title: Re: Grapher
Post by: thydowulays on December 18, 2011, 10:07:39 pm
Yeah once I get this coordinate system in, I may do a DoorsCS style Menu GUI on the bottom that comes with several geometric/algebraic functions...

EDIT: RAGE RAGE RAGE lol. It still doesn't work. fml. ACTUALLY WAIT.... atm, I will be able to add slopes and slope intercept form equations to the program because they don't require coordinates.... w00t.
Title: Re: Grapher
Post by: saintrunner on December 18, 2011, 10:09:41 pm
sounds cool :) if you need help with anything else just post!
Title: Re: Grapher
Post by: thydowulays on December 18, 2011, 10:17:45 pm
Currently adding slope form and slope intercept.... I will make it so that when you press MODE, it will display a box of everything about your line... does anyone know how to use different programs and skip around between the programs like in BASIC? Oh wait, subroutine. I got it now :)
Title: Re: Grapher
Post by: aeTIos on December 19, 2011, 01:51:33 am
at first I thought this was some program that did real graphing like with formulas. That would be cool. This looks great too, tho.
Title: Re: Grapher
Post by: thydowulays on December 19, 2011, 12:44:21 pm
Thanks, I was thinking I would take a new approach to graphing..... people would get a better visual if they could draw the line themselves than punching in numbers...