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. Algorithms
  4. Sloped objects - how to transform a set of points

Sloped objects - how to transform a set of points

Scheduled Pinned Locked Moved Algorithms
performancetutorialquestionannouncement
6 Posts 3 Posters 0 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
    Steve S
    wrote on last edited by
    #1

    I'm roughly up to speed on how to perform things like reflection and rotation, and even simple shear. However, I want to produce a perspective effect on a 2D shape. If we take the case of a rectangle, the left edge would appear nearer the viewer than the right edge. These edges should still be vertical. However, instead of the top and bottom being parallel, they should taper, moving closer together as the X value increases. Is there a 'magic' transformation I can apply, or do I have to iteratively update the points from left to right? For simple shapes (like the rectangle), this wouldn't be too onerous, but I am also looking at generating the same effect for text, where there would be a larger number of points, and the order of the points is not so easy to predict.

    Steve S Developer for hire

    E U 2 Replies Last reply
    0
    • S Steve S

      I'm roughly up to speed on how to perform things like reflection and rotation, and even simple shear. However, I want to produce a perspective effect on a 2D shape. If we take the case of a rectangle, the left edge would appear nearer the viewer than the right edge. These edges should still be vertical. However, instead of the top and bottom being parallel, they should taper, moving closer together as the X value increases. Is there a 'magic' transformation I can apply, or do I have to iteratively update the points from left to right? For simple shapes (like the rectangle), this wouldn't be too onerous, but I am also looking at generating the same effect for text, where there would be a larger number of points, and the order of the points is not so easy to predict.

      Steve S Developer for hire

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

      Steve S wrote:

      However, I want to produce a perspective effect on a 2D shape.

      http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/3d_perspective/[^]

      _________________________ 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 U 2 Replies Last reply
      0
      • E El Corazon

        Steve S wrote:

        However, I want to produce a perspective effect on a 2D shape.

        http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/3d_perspective/[^]

        _________________________ 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
        Steve S
        wrote on last edited by
        #3

        TVM. That sort of helps, except I'm not using OpenGL, but it gives me a few ideas.

        Steve S Developer for hire

        U 1 Reply Last reply
        0
        • E El Corazon

          Steve S wrote:

          However, I want to produce a perspective effect on a 2D shape.

          http://www.cosc.brocku.ca/Offerings/3P98/course/lectures/3d_perspective/[^]

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

          U Offline
          U Offline
          User 12346520
          wrote on last edited by
          #4

          thanks: https://movied.org

          1 Reply Last reply
          0
          • S Steve S

            TVM. That sort of helps, except I'm not using OpenGL, but it gives me a few ideas.

            Steve S Developer for hire

            U Offline
            U Offline
            User 12346520
            wrote on last edited by
            #5

            thanks: https://movied.org

            1 Reply Last reply
            0
            • S Steve S

              I'm roughly up to speed on how to perform things like reflection and rotation, and even simple shear. However, I want to produce a perspective effect on a 2D shape. If we take the case of a rectangle, the left edge would appear nearer the viewer than the right edge. These edges should still be vertical. However, instead of the top and bottom being parallel, they should taper, moving closer together as the X value increases. Is there a 'magic' transformation I can apply, or do I have to iteratively update the points from left to right? For simple shapes (like the rectangle), this wouldn't be too onerous, but I am also looking at generating the same effect for text, where there would be a larger number of points, and the order of the points is not so easy to predict.

              Steve S Developer for hire

              U Offline
              U Offline
              User 12346520
              wrote on last edited by
              #6

              thanks: https://movied.org

              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