2
votes

I'm really new to OpenGL, which is a really bad thing to me :| I need to draw a star(sort of) with openGl but I'm not really sure where I should start.

The results should be something like this:

Is there an easy way to do this?

3

3 Answers

3
votes

the easiest way would be to draw a texture mapped quad with a "star" texture. You can read a tutorial on texture mapping here: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06

That tutorial teaches how to draw a cube using textures. You just have to draw a single face, instead of all six.

The tutorial is written in C++, but near the end you can download the source of a Delphi version.

There are other effects you might want to add later, such as transparency. You can also read about that in the NeHe site. It has a lot of useful tutorials on OpenGL. It's a great place to learn OpenGL.

2
votes

If you're new to OpenGL and if you're using Delphi, then most probably what you need is GLScene. Mature, alive, very good quality of code and, of course, free.

0
votes

Why not write an algorithm to generate a texture procedurally in code using a 2D GLuByte array as in the "checker.c" example in Redbook? Instead of following a perfect checkerboard pattern, figure out how to make a 2D texture of that star and map it into a quad using glTexImage2D(...).