Shop OBEX P1 Docs P2 Docs Learn Events
Circles lines & single points on TV screen using the Propeller. — Parallax Forums

Circles lines & single points on TV screen using the Propeller.

NikosGNikosG Posts: 705
edited 2011-01-13 14:15 in Propeller 1
Hello everybody,

Does anyone know how to display a circle a line and a single point on tv-screen using the propeller demo board?
I tried find the answer looking at the code from the file “Graphics_Demo.spin” originally created by Chip Gracey in 2005. Although this file creates amazing graphics, polygons, stars, etc I couldn’t isolate a command to do a circle or a line. Could you help me?
My final goal is to display on tv-screen the image below using my Propeller demo board and a TV monitor.
logism_ful.jpg
640 x 480 - 185K

Comments

  • TtailspinTtailspin Posts: 1,326
    edited 2011-01-13 07:25
    Check out the "memsic demo.spin" from the Propeller tool- demo library...

    Also try the MXD2125 demo's..

    Maybe even the "HM55B Compass module_TVdemo_V1.4.spin", it has some graphic examples too.
  • potatoheadpotatohead Posts: 10,261
    edited 2011-01-13 08:42
    Look at graphics.spin.
    PUB arc(x, y, xr, yr, angle, anglestep, steps, arcmode)
    
    '' Draw an arc
    ''
    ''   x,y            - center of arc
    ''   xr,yr          - radii of arc
    ''   angle          - initial angle in bits[12..0] (0..$1FFF = 0°..359.956°)
    ''   anglestep      - angle step in bits[12..0]
    ''   steps          - number of steps (0 just leaves (x,y) at initial arc position)
    ''   arcmode        - 0: plot point(s)
    ''                    1: line to point(s)
    ''                    2: line between points
    ''                    3: line from point(s) to center
    
      setcommand(_arc, @x)
    

    It contains the arc command, which will do what you want. Also look at gr.setup or just setup in the graphics.spin program, and you will see it can define resolution, and a coordinate system for your graphics.

    Do you plan on animating this display, or drawing things over, or on it? If so, I've posted up single buffer demonstration code that will help you considerably. I'll track the thread down in a little while.

    A single buffer screen will permit higher than the 256x192 resolution that is the default. You might need it for that graphic to render well.
  • potatoheadpotatohead Posts: 10,261
    edited 2011-01-13 08:43
    Here's the thread: It's the partial buffer one, which is the best overall performance for these kinds of graphics.

    http://forums.parallax.com/showthread.php?128561-Partial-Buffer-Graphics-Demo&p=966184&viewfull=1#post966184
  • NikosGNikosG Posts: 705
    edited 2011-01-13 13:32
    Ttailspin wrote: »
    Check out the "memsic demo.spin" from the Propeller tool- demo library...

    Also try the MXD2125 demo's..

    Maybe even the "HM55B Compass module_TVdemo_V1.4.spin", it has some graphic examples too.

    Thank you Ttailspin!
    Both files you mentioned have excellent graph examples!
    Both are very helpful!!
  • NikosGNikosG Posts: 705
    edited 2011-01-13 14:15
    potatohead wrote: »
    Look at graphics.spin.
    PUB arc(x, y, xr, yr, angle, anglestep, steps, arcmode)
    
    '' Draw an arc
    ''
    ''   x,y            - center of arc
    ''   xr,yr          - radii of arc
    ''   angle          - initial angle in bits[12..0] (0..$1FFF = 0°..359.956°)
    ''   anglestep      - angle step in bits[12..0]
    ''   steps          - number of steps (0 just leaves (x,y) at initial arc position)
    ''   arcmode        - 0: plot point(s)
    ''                    1: line to point(s)
    ''                    2: line between points
    ''                    3: line from point(s) to center
    
      setcommand(_arc, @x)
    

    It contains the arc command, which will do what you want. Also look at gr.setup or just setup in the graphics.spin program, and you will see it can define resolution, and a coordinate system for your graphics.

    Do you plan on animating this display, or drawing things over, or on it? If so, I've posted up single buffer demonstration code that will help you considerably. I'll track the thread down in a little while.

    A single buffer screen will permit higher than the 256x192 resolution that is the default. You might need it for that graphic to render well.

    Thank you potatohead!
    Your replay is very clear. I feel really thankful!
    My display will not be animated. I plan to draw things over it. In fact those concetric circles and the verticillate lines (like target) is the "polar map" and doesn't change. The only movement on the screen happens from the curves with the small stars. Each curve represent the solar path during a specific date. This curve is a gaggle of points that represent the position of the sun at every moment of the day. So the curve will appears gradually.
    I have already created this code on Basic. You can see the screen in action here..
    Now I'm trying to transform the simple Basic code to Spin code.
    I also have some other difficulties with time (I have to add a DS1302 chip).
    I feeI that I have long way to achieve my goal. But I hope that I will be able to contribute the Propeller community with a very useful application!
    Thank you very much again!
    Nikos

    P.s. Your avatar is amazing!
Sign In or Register to comment.