Graphics primitives

Are there any plans for SDL to have graphics primitives? (lines, pixels…) Im
taking my graphics course now and we’re using some archaic graphics library to
draw stuff. Its made to run on the digital unix machines so someone in the
class had to hack it to work on linux. Id be recommending SDL if it had
primitives.

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert Einstein

Garrett wrote:

Are there any plans for SDL to have graphics primitives? (lines, pixels…) Im
taking my graphics course now and we’re using some archaic graphics library to
draw stuff. Its made to run on the digital unix machines so someone in the
class had to hack it to work on linux. Id be recommending SDL if it had
primitives.

http://SparkGL.netpedia.net

Are there any plans for SDL to have graphics primitives? (lines, pixels…) Im
taking my graphics course now and we’re using some archaic graphics library to
draw stuff. Its made to run on the digital unix machines so someone in the
class had to hack it to work on linux. Id be recommending SDL if it had
primitives.

Well, I’ve written a few of these mostly based on Mike Abrash’s old
graphics programming columns in ddj and on the discussions in Foley. I’ve
got lines (both aliased and unantialiased), polygons, ellipses, and Bezier
curves. But if it’s a graphics programming course I think you may be
better off just using straight X Windows. Unless you’re actually trying
to study real scan conversion algorithms such as what I’ve implemented. I
only implemented all of these myself because I’m trying to write a phong
shader and need a polygon fill algorithm so I can see where my normal
vectors are being interpolated.

If you need to set a single pixel, try writing a 1x1 rectangle.On Thu, 2 Sep 1999, Garrett wrote:


| Rafael R. Sevilla @Rafael_R_Sevilla_94 |
| Instrumentation, Robotics, and Control Laboratory |

College of Engineering, University of the Philippines, Diliman

Well we’re using libsx which is just does lines, pixels, polys and filled
polys. For my course all we need are those primitives, we’re going to implement
all the 3d stuff ourselves, including shading and stuff. We have to make our
own 3d rendered. I just figured that since sdl is more portable than this
library (it wouldn’t even port from unix to linux without some modification)
sdl would be better.

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert EinsteinOn Fri, 03 Sep 1999, you wrote:

On Thu, 2 Sep 1999, Garrett wrote:

Are there any plans for SDL to have graphics primitives? (lines, pixels…) Im
taking my graphics course now and we’re using some archaic graphics library to
draw stuff. Its made to run on the digital unix machines so someone in the
class had to hack it to work on linux. Id be recommending SDL if it had
primitives.

Well, I’ve written a few of these mostly based on Mike Abrash’s old
graphics programming columns in ddj and on the discussions in Foley. I’ve
got lines (both aliased and unantialiased), polygons, ellipses, and Bezier
curves. But if it’s a graphics programming course I think you may be
better off just using straight X Windows. Unless you’re actually trying
to study real scan conversion algorithms such as what I’ve implemented. I
only implemented all of these myself because I’m trying to write a phong
shader and need a polygon fill algorithm so I can see where my normal
vectors are being interpolated.

“Rafael R. Sevilla 94-22131” wrote:

Well, I’ve written a few of these mostly based on Mike Abrash’s
old graphics programming columns in ddj and on the discussions in
Foley. I’ve got lines (both aliased and unantialiased), polygons,
ellipses, and Bezier curves.

Interesting. I would be interested in your code for anti-aliased
lines and bezier curves. Did you do anti-aliasing for anything except
lines? I would like to get anti-aliased lines and bezier curves into
our SciTech MGL graphics library (which is Open Source). The new MGL
5.0 that is coming has full support for just about everything
(including arbitrary blending for all graphics primtives ;-).

Regards,±--------------------------------------------------------------+
| SciTech Software - Building Truly Plug’n’Play Software! |
±--------------------------------------------------------------+
| Kendall Bennett | Email: KendallB at scitechsoft.com |
| Director of Engineering | Phone: (530) 894 8400 |
| SciTech Software, Inc. | Fax : (530) 894 9069 |
| 505 Wall Street | ftp : ftp.scitechsoft.com |
| Chico, CA 95928, USA | www : http://www.scitechsoft.com |
±--------------------------------------------------------------+

“Rafael R. Sevilla 94-22131” <@Rafael_R_Sevilla_94> wrote:

Well, I’ve written a few of these mostly based on Mike Abrash’s
old graphics programming columns in ddj and on the discussions in
Foley. I’ve got lines (both aliased and unantialiased), polygons,
ellipses, and Bezier curves.

Interesting. I would be interested in your code for anti-aliased
lines and bezier curves. Did you do anti-aliasing for anything except
lines? I would like to get anti-aliased lines and bezier curves into
our SciTech MGL graphics library (which is Open Source). The new MGL
5.0 that is coming has full support for just about everything
(including arbitrary blending for all graphics primtives ;-).

I implemented the Wu line antialiasing method described by Abrash in one
of his old graphics programming columns, but adapted it to use a 32-bit
fixed-point accumulator (the old column was a 16-bit DOS program). For
fixed backgrounds, it’s only a little slower than the regular Bresenham
algorithm! For different kinds of backgrounds the algorithm spends most
of its time interpolating between the line’s color and the background
color. I’m presently trying to make my own antialiased Bezier curve
algorithm, but my present efforts are less than effective. Not only are
they slow, they also still look pretty lame. Using Wu unantialiased lines
to build up a subdivided curve DOESN’T WORK WELL, so I’m trying to
formulate an area sampling method for antialiasing the curve. Hell, who
knows, maybe I’ll even write a paper for publication in ACM TOG or
Computer Graphics, but chances are someone out there has already
formulated another, more efficient way of doing it! But that doesn’t help
me since my university’s library doesn’t stock those journals. Faugh!

I’d be happy to share whatever info I can.On Fri, 3 Sep 1999, Kendall Bennett wrote:


| Rafael R. Sevilla @Rafael_R_Sevilla_94 |
| Instrumentation, Robotics, and Control Laboratory |

College of Engineering, University of the Philippines, Diliman