[gameprogrammer] Re: textured shapes and 3d objects.

Yes you can fill a circle with a texture using Direct3D and either Visual C++ or C#, but the trick is to make the circle out of a triangle fan, similar to the endcap on a cylinder object.

The simple answer, use something like MS3D or Fragmotion to create a small, thin 1 layer cylinder, then UV Map it using planar mapping, and apply your texture, then simply load it into your application which uses Direct3D or OpenGL, and doing it this way, you can resize the object as needed, and even change the applied texture.

Just a thought.

StOrM3

Roger D Vargas wrote:


Yasser Gonzalez escribió:
I mean to draw a circle and fill it with an image instead a color.
With VC++ it could be easier if you made the image as part of a resource file (.res). I want to load the image from file and fill the circle (or polygon) with it. How I do it??
Again, Nehe texture tutorial. It is very basic. Also, you cant fill a circle, GL (and also Direct 3D) works with non-convex polygons. I guess a trick could be to have a circular image with a transparent out of circle area and apply it to a polygon.

Use openGL or SDL is only the way??? I don't think so.
You should use both. SDL is used to initialize screen and manage events. GL is used for drawing primitives. All Nehe tutorials have an SDL version that runs in both Linux and Windows. Give me a couple of days and I will make some basic example for you. Also Im sending you by mail a simple demo in SDL that loads a bmp and moves it, commented in spanish.



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: