Announcement

Collapse
No announcement yet.

3D-effects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 3D-effects

    I want to draw 3D-border for non-rectangle figure.
    Just now I do following. I select white, insideframe pen and execute PolyPoligon.
    Then, using the same points, select grey Pen and by PolyLine change right and down border.
    After this it's necessary to make offset 1 pixel and to draw black line around right and down parts.
    For horizontal and vertical lines - no problems. But with rounded/diagonal lines occurs troubles.
    I understand, that it possible to create Poligon from vertical and horizontal lines only (with step 1-2 pixels).
    But could be exist better solution ?

  • #2
    Hi Semen,
    Perhaps PolyBezier could be adapted to your border function.

    ------------------
    The most exasperating part of the "rat race" is how often the rats are in the lead!

    Comment


    • #3
      Thanks, Scott, for you reply, but I can't imagine, how to use it.
      I have a line (x1, y1) - (x2, y2) and want to draw (x1, y1 + 1) - (x2, y2 + 1) so, that to have delta y = 1 pixel for each point.
      Which control points I should pass to PolyBezier ?

      ------------------

      Comment


      • #4
        hi semen,

        >>i have a line (x1, y1) - (x2, y2) and want to draw (x1, y1 + 1) - (x2, y2 + 1)
        >>so, that to have delta y = 1 pixel for each point.

        >>which control points i should pass to polybezier ?

        the win32 help file defines:

        bezier spline

        "an irregular curve defined by four points: two endpoints and two control points.
        the endpoints determine where the curve begins and ends. the control points determine
        the shape of the curve; however, unlike the endpoints, the control points do not
        intersect the curve."

        i am only guessing here because i have not used polybezier. i presume it is some
        form of a cubic spline equation. you need to pass data points in two diminsions.

        for example: we have two line segments that will be joined by a bezier curve.
        where line segment 1 = (x1, y1) to (x2, y2)
        where line segment 2 = (x3, y3) to (x4, y4)


        (x1, y1) (x2, y2)
        '*----------------------------*..+ <--- control points in this area?
        ' .
        ' *(x3, y3)
        ' |
        ' |
        ' |
        ' |
        ' |
        ' *(x4, y4)

        the start point would probably be (x2, y2)
        the end point would probably be (x3, y3)

        since the control points determine the shape of the curve, i suspect they might be
        somewhere at or near the corner junction of the two line segments (represented by the plus sign.)

        dave navarro wrote a sample using polybezierto and lance converted it to pbcc. it is called "cool.bas"

        also the following link may be of use

        http://www.powerbasic.com/support/pb...ead.php?t=2072

        scott

        ------------------
        The most exasperating part of the "rat race" is how often the rats are in the lead!

        Comment


        • #5
          forgot about [ code ]

          <font face="courier new, courier" size="3"><pre>
          hi semen,

          >>i have a line (x1, y1) - (x2, y2) and want to draw (x1, y1 + 1) - (x2, y2 + 1)
          >>so, that to have delta y = 1 pixel for each point.

          >>which control points i should pass to polybezier ?

          the win32 help file defines:

          bezier spline

          "an irregular curve defined by four points: two endpoints and two control points.
          the endpoints determine where the curve begins and ends. the control points determine
          the shape of the curve; however, unlike the endpoints, the control points do not
          intersect the curve."

          i am only guessing here because i have not used polybezier. i presume it is some
          form of a cubic spline equation. you need to pass data points in two diminsions.

          for example: we have two line segments that will be joined by a bezier curve.
          where line segment 1 = (x1, y1) to (x2, y2)
          where line segment 2 = (x3, y3) to (x4, y4)


          (x1, y1) (x2, y2)
          '*----------------------------*..+ <--- control points in this area?
          ' .
          ' *(x3, y3)
          ' |
          ' |
          ' |
          ' |
          ' |
          ' *(x4, y4)

          the start point would probably be (x2, y2)
          the end point would probably be (x3, y3)

          since the control points determine the shape of the curve, i suspect they might be
          somewhere at or near the corner junction of the two line segments (represented by the plus sign.)

          dave navarro wrote a sample using polybezierto and lance converted it to pbcc. it is called "cool.bas"

          also the following link may be of use

          http://www.powerbasic.com/support/pb...ead.php?t=2072

          scott
          [/CODE]

          ------------------
          The most exasperating part of the "rat race" is how often the rats are in the lead!

          Comment

          Working...
          X