도전2022

Panorama 360 본문

소스코드

Panorama 360

hotdigi 2014. 1. 7. 07:03
SMALL

http://www.codeproject.com/Articles/16146/Panorama-360



Panorama 360

By 28 Oct 2006
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)

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 have also played a little with C#, but DotNET is something i never use for public code production.


LIST

'소스코드' 카테고리의 다른 글

OpenGL Pixel Buffer Object (PBO)  (0) 2014.01.07
Video Texture in OpenGL  (0) 2014.01.07
Lookup Search - ComboBox Multicolumn, Multiselection  (0) 2014.01.07
Keyword Highlighting  (0) 2014.01.07
bytescout  (0) 2013.01.05