Author Topic: [Axiom] Advanced Graphics [in development]  (Read 16089 times)

0 Members and 1 Guest are viewing this topic.

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
[Axiom] Advanced Graphics [in development]
« 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 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.
  • Filled Circles (aaalmost done)
Fully clipped filled circle routine with variable buffer and variable fill type (on/off/invert) using numerical arguments.

Kinda sorta planned:
  • Vertical/Horizontal Line Segments (on/off/invert)
  • Clipped Lines (on/off/invert)
  • Rectangles (on/off/invert)
  • Rectangle outlines (on/off/invert)
  • Ellipses?

Any other suggestions for what this axiom could have?
« Last Edit: February 28, 2012, 12:41:09 am by ZippyDee »
There's something about Tuesday...


Pushpins 'n' stuff...


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Axiom] Advanced Graphics [in development]
« Reply #1 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

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #2 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).
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 squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #3 on: February 27, 2012, 04:28:45 pm »
This sounds cool, I'm sure a lot of people will find it useful. Good luck!

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #4 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.
There's something about Tuesday...


Pushpins 'n' stuff...


Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #5 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.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #6 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.
There's something about Tuesday...


Pushpins 'n' stuff...


Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [Axiom] Advanced Graphics [in development]
« Reply #7 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.
I'm not a nerd but I pretend:

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #8 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.
There's something about Tuesday...


Pushpins 'n' stuff...


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Axiom] Advanced Graphics [in development]
« Reply #9 on: February 27, 2012, 04:41:57 pm »
Question, how does the line routine speed compares to the built-in Axe one?

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #10 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.
There's something about Tuesday...


Pushpins 'n' stuff...


Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #11 on: February 27, 2012, 04:44:01 pm »
Circles anyone? :D

Hint: trying pressing arrow keys, +, -, *, /, enter, and clear to exit.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [Axiom] Advanced Graphics [in development]
« Reply #12 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

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #13 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.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: [Axiom] Advanced Graphics [in development]
« Reply #14 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:
There's something about Tuesday...


Pushpins 'n' stuff...