Click here to Skip to main content
11,493,046 members (54,633 online)
Click here to Skip to main content

Planet 3D (Alias GL Earth)

, 13 Nov 2006 CPOL 76K 6K 73
Rate this:
Please Sign up or sign in to vote.
OpenGL moving planet
Sample Image - planet3d.jpg

Introduction

The project exclusively uses the features found in VISUAL C# 2005 Express Edition.

Planet 3D is a companion to my Panorama contribution, that has already been posted there.

The demo is provided with several textures to create the stellar background and each of the planets.

Note: In order to keep the size of the ZIP file small, the provided textures are in low resolution mode (I have larger resolution that I can send on demand).

The control uses 3D polar coordinates, and either keyboard direction key or buttons to change the planet rotation angle.

You can also use the left mouse button while in the OpenGL control to rotate the planet.

Several classes and "user controls" help the creation of the skinned button and the dedicated trackbar.

Smooth zooming is used to enlarge or reduce the size of the planet while the stellar background is left unchanged.

Code Insight

SkinEngine.cs

This class is responsible for the drawing of skinned form and custom controls.

SkinButton.cs

User control to create skinned button using one single 5-image bitmap matching each of the button states: normal, down, disabled, focused, hover.
You can use either "standard" push button or shaped button with region.

SkinTrackbar.cs

User control to create a mouse only skinned track bar.
The thumb tracker can have any size or shape based on a provided bitmap.
The control orientation is based on the ratio between width and height; if width is larger than height then horizontal else vertical.
To help the user to figure the moving of the thumb track, the control draws a layered triangle over the background and uses a tooltip to show the current value.
You can inverse ranging swapping min/max values.

OpenGL.cs

Encapsulation of the OpenGL API being used.

Win32.cs

Encapsulation of the Win32 API being used.

GDImage.cs

Encapsulation of the GDImage API being used.
GDImage is a prerequisite to create OpenGL font and convert image to GL texture on the fly.

Comment

I hope you will like Planet 3D and perhaps learn a few things from it.

You will find more contributions on my Web site in the "C# corner" section.

History

  • 13th November, 2006: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

zapsolution
Software Developer zapsolution
France France
I am a low level SDK programmer, focusing mainly on graphic imaging and multimedia applications.
I am using several languages, including C, C++, PowerBASIC, WinDev.
I wrote also a few demos in C#, but i never used DotNET in real code production.

Comments and Discussions

 
Questioni need help!!! Pin
Member 1168633012-May-15 20:55
memberMember 1168633012-May-15 20:55 
GeneralMy vote of 5 Pin
manoj kumar choubey26-Feb-12 21:02
membermanoj kumar choubey26-Feb-12 21:02 
GeneralVS2008 project and Larger resolution textures Pin
pham duc duy26-Sep-10 0:51
memberpham duc duy26-Sep-10 0:51 
GeneralCould you send me the vs2010 project file? Thanks! Pin
zongdejuo14-Jan-10 19:27
memberzongdejuo14-Jan-10 19:27 
GeneralRe: Could you send me the vs2010 project file? Thanks! Pin
zapsolution14-Jan-10 22:12
memberzapsolution14-Jan-10 22:12 
GeneralRe: Could you send me the vs2010 project file? Thanks! Pin
zongdejuo14-Jan-10 23:16
memberzongdejuo14-Jan-10 23:16 
GeneralRe: Could you send me the vs2010 project file? Thanks! Pin
dong_jason@hotmail.com17-Jun-11 2:28
memberdong_jason@hotmail.com17-Jun-11 2:28 
GeneralRe: Could you send me the vs2010 project file? Thanks! Pin
zapsolution17-Jun-11 3:26
memberzapsolution17-Jun-11 3:26 
QuestionIt's a nice work. Pin
zongdejuo8-Jan-10 12:28
memberzongdejuo8-Jan-10 12:28 
AnswerRe: It's a nice work. Pin
zapsolution8-Jan-10 22:50
memberzapsolution8-Jan-10 22:50 
GeneralRe: It's a nice work. Pin
zongdejuo9-Jan-10 0:12
memberzongdejuo9-Jan-10 0:12 
GeneralRe: It's a nice work. Pin
zapsolution9-Jan-10 1:20
memberzapsolution9-Jan-10 1:20 
GeneralRe: It's a nice work. [modified] Pin
zongdejuo10-Jan-10 9:19
memberzongdejuo10-Jan-10 9:19 
GeneralRe: It's a nice work. Pin
zapsolution10-Jan-10 12:29
memberzapsolution10-Jan-10 12:29 
GeneralRe: It's a nice work. Pin
zongdejuo10-Jan-10 19:25
memberzongdejuo10-Jan-10 19:25 
GeneralRe: It's a nice work. Pin
zapsolution10-Jan-10 21:51
memberzapsolution10-Jan-10 21:51 
GeneralRe: It's a nice work. Pin
zongdejuo11-Jan-10 11:44
memberzongdejuo11-Jan-10 11:44 
GeneralYour Web Site Pin
Programm3r7-Sep-09 22:23
memberProgramm3r7-Sep-09 22:23 
GeneralRe: Your Web Site Pin
zapsolution8-Sep-09 0:04
memberzapsolution8-Sep-09 0:04 
QuestionMore info on Open GL Pin
axe.delhi21-Oct-07 20:08
memberaxe.delhi21-Oct-07 20:08 
AnswerRe: More info on Open GL Pin
zapsolution21-Oct-07 22:21
memberzapsolution21-Oct-07 22:21 
Questionkeep rendering, could not operate Pin
Unruled Boy15-Nov-06 16:13
memberUnruled Boy15-Nov-06 16:13 
AnswerRe: keep rendering, could not operate Pin
zapsolution15-Nov-06 22:03
memberzapsolution15-Nov-06 22:03 
GeneralRe: keep rendering, could not operate Pin
haikbaba21-Nov-06 13:23
memberhaikbaba21-Nov-06 13:23 
GeneralAwesome Pin
Chris Maunder14-Nov-06 8:14
adminChris Maunder14-Nov-06 8:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150520.1 | Last Updated 13 Nov 2006
Article Copyright 2006 by zapsolution
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid