Author Topic: Curves in Axe  (Read 3481 times)

0 Members and 1 Guest are viewing this topic.

Offline collechess

  • LV3 Member (Next: 100)
  • ***
  • Posts: 93
  • Rating: +22/-2
    • View Profile
Curves in Axe
« on: December 06, 2011, 06:08:50 pm »
How do you draw curves in axe? 

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Curves in Axe
« Reply #1 on: December 06, 2011, 06:17:29 pm »
To draw a curve, you could either calculate the position of each pixel, and use the pixel commands to plot them.  Or alternatively, calculate the positions of several points along the curve and connect them with lines.  The closer together the points, the more accurate the drawing, but since the screen it pretty course, you would probably be able to get away with relatively low accuracy. 

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Curves in Axe
« Reply #2 on: December 07, 2011, 01:46:46 am »
I once made a Bezier curve drawer based off of an algorithm I found here: http://freespace.virgin.net/hugo.elias/graphics/x_bezier.htm.

To elaborate on Builderboy's point, you could calculate the the precise locations of the points by either stepping through an equation such as a parabolic or sinusoidal one, or alternatively use an algorithm such as the Bezier curve (which I guess is sort of like stepping through an equation, except cooler.)
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.