Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / C#
Article

Panorama 360

Rate me:
Please Sign up or sign in to vote.
4.45/5 (14 votes)
28 Oct 2006CPOL1 min read 119.5K   7.2K   51   19
OpenGL full 360 spherical panorama
Sample Image - panorama_net.jpg

Introduction

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

The purpose of this demo is to mimic the JAVA applets that can be found over the NET to create virtual tours.

Animation

Use either buttons or direction keys to change view angle.

About the Code

The code itself is small, but there are two important points:

  1. Handling of keyboard direction keys is done in Form_KeyDown and Form_PreviewKeydown, this is to bypass the nasty TAB order that would rather put the focus on trackbar, instead of the OpenGL control.
  2. To perform smooth animation and limit CPU usage I am using a tip, using StartAnimation and the WndProc Api.WM_TIMER message, altogether.

Note: I am using GDImage to select a new panorama and create OpenGL texture and font on the fly, but you can use any other OpenGL helper doing the same, this won't affect the core RenderOpenGL method.

Apart of the MAIN_Form class, the project uses 3 specific classes:

  • OpenGL.cs (dedicated OpenGL API encapsulation)
  • Win32.cs (low level Win32 API encapsulation)
  • GDImage.cs (low level graphic encapsulation)

ZIP Content

  • Project source code for .NET 2.0+
  • Two JPEG textures in the \bin\debug folder
  • GDImage.dll in the \bin\debug folder (prerequisite to create OpenGL texture and font on the fly)

Enjoy!

You can check for the latest version here in the "C# corner" section.
You will also find on my C# Web page other demos that haven't been posted here.

History

  • 29th October, 2006: Initial post

License

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


Written By
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

 
Questiondoes not work in Windows 8 Pin
Jayson Ragasa8-Nov-14 20:51
Jayson Ragasa8-Nov-14 20:51 
SuggestionRe: does not work in Windows 8 Pin
Member 127961694-Nov-16 22:57
Member 127961694-Nov-16 22:57 
GeneralRe: does not work in Windows 8 Pin
zapsolution4-Nov-16 23:45
zapsolution4-Nov-16 23:45 
QuestionCannot use it with Visual Studio 2010 Pin
Dark Lord Malik6-Apr-12 2:00
Dark Lord Malik6-Apr-12 2:00 
GeneralMy vote of 5 Pin
Manoj Kumar Choubey26-Feb-12 20:01
professionalManoj Kumar Choubey26-Feb-12 20:01 
GeneralMy vote of 4 Pin
borlittle1-Jul-11 19:05
borlittle1-Jul-11 19:05 
QuestionQuality of Image Pin
zahra nessri8-Jan-11 22:12
zahra nessri8-Jan-11 22:12 
AnswerRe: Quality of Image Pin
zapsolution9-Jan-11 0:22
zapsolution9-Jan-11 0:22 
GeneralCombine more than 2 images to genrate panorama Pin
Pawan Gupta Lucknow8-Dec-10 8:30
Pawan Gupta Lucknow8-Dec-10 8:30 
Generalquestion Pin
loloberro24-Feb-07 6:23
loloberro24-Feb-07 6:23 
GeneralRe: question Pin
zapsolution24-Feb-07 8:36
zapsolution24-Feb-07 8:36 
GeneralRe: question Pin
Tiramisung17-Mar-10 21:19
Tiramisung17-Mar-10 21:19 
GeneralRe: question Pin
zapsolution17-Mar-10 21:49
zapsolution17-Mar-10 21:49 
GeneralPanorama 360 demo Pin
Blubbo31-Oct-06 2:49
Blubbo31-Oct-06 2:49 
Questionin a webform? Pin
robrich30-Oct-06 3:51
robrich30-Oct-06 3:51 
AnswerRe: in a webform? Pin
zapsolution30-Oct-06 4:18
zapsolution30-Oct-06 4:18 
GeneralRe: in a webform? Pin
Jasmine25011-Nov-06 5:12
Jasmine25011-Nov-06 5:12 
QuestionGetting the Jpeg Pin
Cliff Stanford30-Oct-06 0:41
Cliff Stanford30-Oct-06 0:41 
AnswerRe: Getting the Jpeg Pin
zapsolution30-Oct-06 4:23
zapsolution30-Oct-06 4:23 

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

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