Omnimaga

Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: ZippyDee on February 27, 2012, 04:02:50 pm

Title: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on February 27, 2012, 04:02:50 pm
This has been in the works for a few weeks now, so I thought I'd make a thread about it.

I began writing this Axiom with a fixed-memory flood fill routine, but I failed miserably. I finally convinced jacobly to give it a try. Together we completely optimized the algorithm and he was able to write an awesomely optimized version. Then I started working on a filled circle algorithm, which jacobly volunteered to convert to Axiom format for me, but a few *cough* bugs were found. He has since been working with me to fix those bugs. All-in-all, this is basically an Axiom by both jacobly and myself.

This Axiom will be a collection of more advanced graphics routines which we hope will be greatly useful for graphics programs, and potentially games as well. Some of the routines will definitely NOT be useful for games, due to speed issues.

Currently written:
"Fixed-memory" means there is no risk for stack overflow AT ALL. However, the routine is subsequently very slow, so it will not be suitable for games or anything that needs fast dynamic area filling. It would be fine for a "paint bucket" tool in most on-calc graphics programs though. This will *hopefully* support grayscale filling as well.
Fully clipped filled circle routine with variable buffer and variable fill type (on/off/invert) using numerical arguments.

Kinda sorta planned:

Any other suggestions for what this axiom could have?
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: DJ Omnimaga on February 27, 2012, 04:20:58 pm
So I assume that is what you and Jacobly have been discussing on IRC at night in the past week or so, right? It seems nice as there seems to have been a lot of work being done on this so far. Screenshots would be nice to showcase the routines and how fast they were (make programs where you move the shapes/lines around and stuff maybe).

Clipped lines would be very handy for Boot2490's project, because he wanted to do some sort of GlassCars clone in Axe, but more Mario Kart style.

Glad it has on/off/invert too. no more need to manually invert the entire LCD everytime we draw lines. :P
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: Hayleia on February 27, 2012, 04:27:08 pm
Great idea :D
May Jacobly post here so he can be +1'd too ?

Any other suggestions for what this axiom could have?
Ellipses and filled ellipses (I don't really know how it is called in English but I guess it is called like that).
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: squidgetx on February 27, 2012, 04:28:45 pm
This sounds cool, I'm sure a lot of people will find it useful. Good luck!
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on February 27, 2012, 04:33:14 pm
Great idea :D
May Jacobly post here so he can be +1'd too ?

Any other suggestions for what this axiom could have?
Ellipses and filled ellipses (I don't really know how it is called in English but I guess it is called like that).

Ellipses are not nearly as easy as circles, but that *might* find its way into the Axiom at some point...We certainly need to get this filled-circle routine done first.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: LincolnB on February 27, 2012, 04:34:34 pm
Some form of curves, I'm not sure syntactically how the function would be called, would be nice. Also, being able to do everything on multiple buffers would be really nice.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on February 27, 2012, 04:35:04 pm
Some form of curves, I'm not sure syntactically how the function would be called, would be nice. Also, being able to do everything on multiple buffers would be really nice.
All commands will have variable buffer arguments.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: aeTIos on February 27, 2012, 04:39:17 pm
Ellipses are EASY. No, no offense. You can draw an ellipse (unfortunately only horizontal and vertical) using multipliers on the sine andor cosine.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on February 27, 2012, 04:41:13 pm
Ellipses are EASY. No, no offense. You can draw an ellipse (unfortunately only horizontal and vertical) using multipliers on the sine andor cosine.
You think we calculate the sin/cos of every point on this circle? These routines use integer arithmetic. Calculating the sin/cos of every point would be really slow and unnecessary. Sure, it's POSSIBLE, but there are better ways to do it. Implementing those better ways is what is difficult.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: DJ Omnimaga on February 27, 2012, 04:41:57 pm
Question, how does the line routine speed compares to the built-in Axe one?
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on February 27, 2012, 04:43:10 pm
Question, how does the line routine speed compares to the built-in Axe one?
Well, that's a good question...It hasn't been written yet, so I can't answer it :P

There has been talk that if a clipped line routine is developed, Axe would use that one and this axiom might instead implement a non-clipped line routine for people who want the extra speed and don't need clipping.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: jacobly on February 27, 2012, 04:44:01 pm
Circles anyone? :D

Hint: trying pressing arrow keys, +, -, *, /, enter, and clear to exit.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: DJ Omnimaga on February 27, 2012, 04:49:59 pm
Question, how does the line routine speed compares to the built-in Axe one?
Well, that's a good question...It hasn't been written yet, so I can't answer it :P

There has been talk that if a clipped line routine is developed, Axe would use that one and this axiom might instead implement a non-clipped line routine for people who want the extra speed and don't need clipping.
Oh ok. I was wondering since I am curious if for a 3D program like boot2490's it would be fast enough to allow a game to be playable.
Circles anyone? :D

Hint: trying pressing arrow keys, +, -, *, /, enter, and clear to exit.
That looks nice and seems quite fast actually. Here's a screenshot by the way :D
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: LincolnB on February 27, 2012, 04:54:19 pm
Looks very cool - but I'm not sure I got my question about curves (not ellipses) answered.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on February 27, 2012, 05:00:38 pm
Looks very cool - but I'm not sure I got my question about curves (not ellipses) answered.
What kind of curves are you talking about? Bezier curves? Michael_Lee wrote an axe program to do Bezier Curves a while ago. I think it's in the Axe routines thread.

Also, another screenshot of circles:
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: TIfanx1999 on February 28, 2012, 08:04:30 am
It looks really nice! Good work guys! =)
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: kindermoumoute on March 02, 2012, 11:25:51 am
That's look pretty nice, where can I download it (same if that's not finished) ?
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: jacobly on March 04, 2012, 05:54:43 pm
CircleF( is on the Vars Window menu for now.
CircleF(X,Y,R)Draws a filled circle with center (X,Y) and radius R on the main buffer.
CircleF(X,Y,R)rDraws a filled circle with center (X,Y) and radius R on the back buffer.
CircleF(X,Y,R,BUF)Draws a filled circle with center (X,Y) and radius R on the specified buffer.
CircleF(X,Y,R,BUF,MODE)Draws a cleared/inverted/filled circle with center (X,Y) and radius R on the specified buffer. Mode 0 is clear, Mode 1 is invert, and Mode 2 is fill.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: Hayleia on March 05, 2012, 12:15:18 pm
That looks great :D. Do they clip too ?

edit: ok it was a stupid question if people look at the screenshots but there is no screenshot in the first post as far as I can tell, and it still says "almost done" for clipping so I don't see any reason for being downrated.
"Fixed" by hellninjas :P
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: hellninjas on March 05, 2012, 12:19:14 pm
:O i have to get home quick now!
Must download!


I've been waiting for such a thing!
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on March 05, 2012, 01:20:08 pm
That looks great :D. Do they clip too ?
Everything clips entirely. That's part of what kept delaying the release so much :P
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: Hayleia on March 05, 2012, 01:26:30 pm
That looks great :D. Do they clip too ?
Everything clips entirely. That's part of what kept delaying the release so much :P
*.*
I would download it If I didn't already :P
This will be a great help for my level editor :D
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: hellninjas on March 05, 2012, 05:13:58 pm
The circle.8xv wont transfer to my calc!
SO MUCH ANNOYANCE!
http://screencast.com/t/ElThkqHco72 heres a pic of whats happening...
It's not corrupt cause I just got it, but could you RE-upload it
or something?
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: jacobly on March 05, 2012, 07:36:30 pm
Let me know if this works.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: hellninjas on March 05, 2012, 07:55:17 pm
Works! Thanks a bunch :D
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: leafy on March 06, 2012, 02:44:23 am
Zippy, I get an invalid number of arguments when i try to pass the five args needed to change the mode -maybe check up on that?
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: DJ Omnimaga on March 06, 2012, 03:34:38 am
Btw does circles support black? I notice you only got dark gray and light gray .
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: kindermoumoute on March 06, 2012, 07:04:55 am
That's because he choosed to use DispGraph^rr command. But his axiom allows to draw in any buffer (buffer, back-buffer, or other). ;)
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on March 06, 2012, 05:14:36 pm
Posted a poll about the order for arguments in CircleF. What do y'all think?
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: LincolnB on March 06, 2012, 05:46:49 pm
I personally voted for the buffer argument to come last, that's how it's always been for me in Axe commands. Honestly though to me it doesn't matter much.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: jacobly on March 06, 2012, 08:31:50 pm
I went with the other order because of the current command: Bitmap(X,Y,BMP,BUF,MODE). Although, I have to admit that the other way makes a lot of sense.

CircleF( is on the Vars Window menu for now.
CircleF(X,Y,R)Draws a filled circle with center (X,Y) and radius R on the main buffer.
CircleF(X,Y,R)rDraws a filled circle with center (X,Y) and radius R on the back buffer.
CircleF(X,Y,R,MODE)Draws a cleared/inverted/filled circle with center (X,Y) and radius R on the main buffer. Mode 0 is clear, Mode 1 is invert, and Mode 2 is fill.
CircleF(X,Y,R,MODE)rDraws a cleared/inverted/filled circle with center (X,Y) and radius R on the back buffer. Mode 0 is clear, Mode 1 is invert, and Mode 2 is fill.
CircleF(X,Y,R,MODE,BUF)Draws a cleared/inverted/filled circle with center (X,Y) and radius R on the specified buffer. Mode 0 is clear, Mode 1 is invert, and Mode 2 is fill.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: kindermoumoute on March 13, 2012, 02:09:52 pm
Currently written:
  • Fixed-Memory Flood Fill (needs optimization)
"Fixed-memory" means there is no risk for stack overflow AT ALL. However, the routine is subsequently very slow, so it will not be suitable for games or anything that needs fast dynamic area filling. It would be fine for a "paint bucket" tool in most on-calc graphics programs though. This will *hopefully* support grayscale filling as well.

Is this feature released ? Which command do that ? ???
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: leafy on March 13, 2012, 02:38:20 pm
I don't think it's been released in this axiom yet.
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: ZippyDee on March 17, 2012, 07:00:20 pm
Currently written:
  • Fixed-Memory Flood Fill (needs optimization)
"Fixed-memory" means there is no risk for stack overflow AT ALL. However, the routine is subsequently very slow, so it will not be suitable for games or anything that needs fast dynamic area filling. It would be fine for a "paint bucket" tool in most on-calc graphics programs though. This will *hopefully* support grayscale filling as well.

Is this feature released ? Which command do that ? ???

This has not been released yet. Jacobly still has to optimize it. Bug him about it. :D
Title: Re: [Axiom] Advanced Graphics [in development]
Post by: kindermoumoute on June 28, 2012, 04:20:58 pm
Up ? :)