Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. drawing algorithms

drawing algorithms

Scheduled Pinned Locked Moved Graphics
graphicsquestion
10 Posts 3 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sarah_malik
    wrote on last edited by
    #1

    Hi, where can I find algorithms for drawing different shapes, I found some to draw spiral and circle, but I need to have more shapes. Can you please recommend any website(s) that helps? thanks,

    E 1 2 Replies Last reply
    0
    • S sarah_malik

      Hi, where can I find algorithms for drawing different shapes, I found some to draw spiral and circle, but I need to have more shapes. Can you please recommend any website(s) that helps? thanks,

      E Offline
      E Offline
      El Corazon
      wrote on last edited by
      #2

      just more? nothing specific? http://www.acm.org/tog/GraphicsGems/[^]

      _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

      S 1 Reply Last reply
      0
      • E El Corazon

        just more? nothing specific? http://www.acm.org/tog/GraphicsGems/[^]

        _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

        S Offline
        S Offline
        sarah_malik
        wrote on last edited by
        #3

        thanks El Corazon, I don't need any specific shape, for example: for( int i=0 ; i<200 ; ++i) { theta = 2+Math::PI*float(i)/10; r = Math::Sqrt(theta); x=r*Math::Cos(theta)+400; y=r*Math::Sin(theta)+400; } this algorithm will give me a very beautiful shape. I need more algorithms that would to the same.

        E 1 Reply Last reply
        0
        • S sarah_malik

          thanks El Corazon, I don't need any specific shape, for example: for( int i=0 ; i<200 ; ++i) { theta = 2+Math::PI*float(i)/10; r = Math::Sqrt(theta); x=r*Math::Cos(theta)+400; y=r*Math::Sin(theta)+400; } this algorithm will give me a very beautiful shape. I need more algorithms that would to the same.

          E Offline
          E Offline
          El Corazon
          wrote on last edited by
          #4

          sarah_malik wrote:

          I need more algorithms that would to the same.

          there are many. It is called a polar graph, or polar equation. That particular one is one of the more simple ones. x=r*cos(theta); y=r*sin(theta); is the translation from polar (radius=r, angle=theta) coordinates to Cartesian coordinates. You can make your own and experiment with others from here: http://www.analyzemath.com/polarcoordinates/polarcoordinates.html[^] http://www.analyzemath.com/polarcoordinates/graphing_polar_equations.html[^] I did many polar coordinates on my first computer, including a spider's web. :)

          _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

          1 Reply Last reply
          0
          • S sarah_malik

            Hi, where can I find algorithms for drawing different shapes, I found some to draw spiral and circle, but I need to have more shapes. Can you please recommend any website(s) that helps? thanks,

            1 Offline
            1 Offline
            123 0
            wrote on last edited by
            #5

            [Message Deleted]

            E S 2 Replies Last reply
            0
            • 1 123 0

              [Message Deleted]

              E Offline
              E Offline
              El Corazon
              wrote on last edited by
              #6

              The Grand Negus wrote:

              the number of things you can draw with formulas is seriously limited.

              Actually, the number of things you can draw with formulas are infinite, but not all of them attractive. In many cases, one formula provides infinite variations, though subtle, and given multiple formulas and methods (like fractals?), the list goes on.... however... that was why I pointed to the graphics gems first, which covers algorithmic drawing in detail.

              _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

              1 Reply Last reply
              0
              • 1 123 0

                [Message Deleted]

                S Offline
                S Offline
                sarah_malik
                wrote on last edited by
                #7

                Thanks for your help, it was very useful. I was wondering if there are more available algorithms that would draw shapes other than polar. like these beautiful ones: http://www.flickr.com/photos/fire_brace/48702455/in/set-72057594133787168/[^] http://www.flickr.com/photos/fire_brace/48723545/in/set-72057594133787168/[^] I know these are mosaics, but I just need algorithms that would draw such things.

                E 1 Reply Last reply
                0
                • S sarah_malik

                  Thanks for your help, it was very useful. I was wondering if there are more available algorithms that would draw shapes other than polar. like these beautiful ones: http://www.flickr.com/photos/fire_brace/48702455/in/set-72057594133787168/[^] http://www.flickr.com/photos/fire_brace/48723545/in/set-72057594133787168/[^] I know these are mosaics, but I just need algorithms that would draw such things.

                  E Offline
                  E Offline
                  El Corazon
                  wrote on last edited by
                  #8

                  sarah_malik wrote:

                  but I just need algorithms that would draw such things.

                  check out the formulas behind fractals. There are many self-similar iterative design systems. http://en.wikipedia.org/wiki/Fractal[^] also L-Systems: http://en.wikipedia.org/wiki/L-system[^]

                  _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                  S 1 Reply Last reply
                  0
                  • E El Corazon

                    sarah_malik wrote:

                    but I just need algorithms that would draw such things.

                    check out the formulas behind fractals. There are many self-similar iterative design systems. http://en.wikipedia.org/wiki/Fractal[^] also L-Systems: http://en.wikipedia.org/wiki/L-system[^]

                    _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                    S Offline
                    S Offline
                    sarah_malik
                    wrote on last edited by
                    #9

                    THANK YOU.:rose:

                    E 1 Reply Last reply
                    0
                    • S sarah_malik

                      THANK YOU.:rose:

                      E Offline
                      E Offline
                      El Corazon
                      wrote on last edited by
                      #10

                      You are welcome. The hardest part is trying to figure out what you are looking for. There are as many shapes as the imagination, and as many methods of getting them. :)

                      _________________________ Asu no koto o ieba, tenjo de nezumi ga warau. Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups