First steps in OpenGL

29 views
Skip to first unread message

Fabian Cenedese

unread,
May 17, 2013, 7:16:16 AM5/17/13
to wx-u...@googlegroups.com
Hi

wxMSW 2.9 (svn)

I want to create a simple game where geometric 3D-Objects move
in front of a background. It's intended to be some kind of quiz show.
I decided to give OpenGL a try since that would help with all the
transforming, rotating and lighting. That's why I looked into the
OpenGL samples.

The isosurf and penguin samples load objects from files but I want
to create my objects in the program since I want to adjust them
(at least the texture). So I played around with the cube sample.
It doesn't really create an object but rotates and paints textures.
But that could be enough for my purposes.

I changed the cube sides to circles. As the background is cleared
with the transparent brush I expected to see my colored frame
background. But the corners still paint black over the background.

static wxImage DrawDice(int size, unsigned num)
{
...
wxMemoryDC dc;
dc.SelectObject(bmp);
// make default transparent
dc.SetBackground(*wxTRANSPARENT_BRUSH);
dc.Clear();
dc.SetBackground(*wxWHITE_BRUSH);
// dc.Clear();
// use a 'round' cube side
dc.DrawCircle(size/2, size/2, size/2);

Do I need to adjust the way that the cube textures
are painted to get transparency? Is this the right
way to go along at all? Does anybody have a sample
project of creating a 'real' 3D object in code
(e.g. a pyramid or a torus) and texture it?

Thanks

bye Fabi

Adrián Arroyo Calle

unread,
Jun 1, 2013, 7:57:43 AM6/1/13
to wx-u...@googlegroups.com
Hi Fabian,

If you are interested in OpenGL+wxWidgets+wxImage I think that you can look at my game source code. Load textures from real images and put it in OpenGL. The URL is here: http://bazaar.launchpad.net/~divel/azpazeta/juno/files

cenedese

unread,
Jun 4, 2013, 5:01:12 AM6/4/13
to wx-u...@googlegroups.com

Cool, thanks. I'll have a look when I get to it. Right now I'm sick in bed...

 

bye  Fabi


-----Original-Nachricht-----
Von: "Adrián Arroyo Calle" <adrian.ar...@gmail.com>
An: wx-u...@googlegroups.com
Datum: 01.06.2013 14:10
Betreff: Re: First steps in OpenGL
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
 
To unsubscribe, send email to wx-users+u...@googlegroups.com
or visit http://groups.google.com/group/wx-users
 
 

Reply all
Reply to author
Forward
0 new messages