Software-OK
≡... News | ... Home | ... FAQ | Impressum | Contact | Listed at | Thank you |

  
HOME ► Faq ► FAQ - Windows-CPP-und-C ► ««« »»»

A 3d labyrinth with OpenGL and c++ under Windows!


You will find it is easy to program a 3D maze with OpenGL and C++ under Windows!



I have found that I have written a large number of interesting and perhaps sometimes useful applications. I have been programming for a number of years, starting with Turbo c and trying out C++, Java, Perl, JavaScript, Python, Perl and a few things with MS Visual Studio. Over the years I have created a number of programs, see http:www.softwareok.de  , which may be of interest to others. 

These programs I discovered and may look simple for experts, but I hope they can be useful for beginners. 
 
Here I want to present you a short source code of a small labyrinth game created in 2005 using C++, OpenGL glut32 and a bit of passion from the developer. In the game you are a lonely red ball in the big terrible labyrinth. Your only wish is to find an exit from the randomly generated labyrinth. It's strange, but the exit is a yellow ball ;). The source code and binaries of this application are available on GitHub.

https://github.com/sergey-tihon/Ravent-App-Store/tree/master/SuperSDG2


I compiled it here with MS Visual Studio 6.0, so anyone can create it with any other (higher versions). This random labyrinth is really a nice thing! 
... DL_Opengl/RandomLabyrinth.zip

(Image-1) A 3d labyrinth with OpenGL and c++ under Windows!
A 3d labyrinth with OpenGL and c++ under Windows!


PS:

Putting together such a simulation requires a complex, multidisciplinary development process. Issues of design, physics, etc. need to be addressed, as well as the computer science problems of 3D programming and a random maze game. Therefore, much of the design work evident here and much of the code presented here will be well suited to those who are particularly interested in certain aspects of the implementation, and then you can get more benefit from it.   Here is a second example I discovered! http://beaugg.blogspot.com/2014/07/random-3d-mazes-in-opengl.html

-
▲ Back to the top ▲





(Image-2) A 3D labyrinth with OpenGL and c++ under Windows!
A 3d labyrinth with OpenGL and c++ under Windows!

The program described here uses OpenGL to render a three-dimensional maze through which the user must maneuver (walk or run) using the mouse and/or arrow keys. A first-person perspective is used, with collision detection implemented on the maze walls. Each maze is randomized, and furthermore each maze has only a single best (i.e. detour-free) solution path. The size and difficulty of the maze are controlled by compile-time constants. By default, a relatively simple maze is provided, but during testing very large and cumbersome mazes were simulated with good results.

The demonstration code is less than 650 lines long, even with liberal use of comments. The code provided is therefore architecturally minimalist. Like much of OpenGL itself, the demo is mostly a plain C program. This makes for a clear presentation that can still be adapted to more complex designs.
 
The simulation developed here is somewhat similar in appearance to Wolfenstein 3D, one of the earliest widely used 3D simulations. However, the use of OpenGL enables some effects not seen in Wolfenstein 3D.
 
For example, at the start of each game session, the user drops into the game world from above, as if by parachute, near the entrance to the maze. This provides the user with the opportunity to view the maze solution just before the game begins, and adds another skill dimension to the game. An example of this aerial style view is shown below:


-
▲ Back to the top ▲






FAQ 19: Updated on: 4 September 2024 09:53 Windows
Windows-CPP-und-C

Why optimize graphics and improve performance?


If you want to present to a large audience and show your game or graphics program in its best light, it is important that you include the Ultrabooks. These
Windows-CPP-und-C

joyGetPosEx function to query the joystick / controller position!


It is easy to use with joyGetPosEx function to query the joystick / controller position under Windows Required:  Identifier of the joystick to be queried.
Windows-CPP-und-C

ARRAYSIZE Error creating, fix!


Its simple - ARRAYSIZE Error creating, fix error message: : error C2065: ARRAYSIZE : undeclared identifier   Contents: 1. Fixing the ARRAYSIZE error
Windows-CPP-und-C

Alternative to RegDeleteTree!


You can easily write your own routine for RegDeleteTree, or RegDeleteTreeW and RegDeleteTreeA Alternatively you can also  use SHDeleteKeyA or  SHDeleteKeyW
Windows-CPP-und-C

Replace string for unicode in c++ visual studio!


Often, when transitioning from ANSI to Unicode, you need to replace string literals in your C++ code. This is especially important for making your applications
Windows-CPP-und-C

Difference between _ttof, atof, _atof_l, _wtof, _wtof_l in C++ and C?


Heres the translation and explanation of the differences between _ttof, atof, _atof_l, _wtof, and _wtof_l in C++ and C, focusing on string conversion functions:
Windows-CPP-und-C

Invert color RGB COLORREF InvertColor(COLORREF lColor)!


Heres the translation and explanation of how to invert a color using RGB values and the COLORREF structure with the InvertColor  function: 1. Macros for

»»

  My question is not there in the FAQ
Asked questions on this answer:
Keywords: cpp, windows, labyrinth, with, opengl, under, find, easy, program, maze, have, found, that, written, large, number, interesting, perhaps, Questions, Answers, Software




  

  + Freeware
  + Order on the PC
  + File management
  + Automation
  + Office Tools
  + PC testing tools
  + Decoration and fun
  + Desktop-Clocks
  + Security

  + SoftwareOK Pages
  + Micro Staff
  + Freeware-1
  + Freeware-2
  + Freeware-3
  + FAQ
  + Downloads

  + Top
  + Desktop-OK
  + The Quad Explorer
  + Don't Sleep
  + Win-Scan-2-PDF
  + Quick-Text-Past
  + Print Folder Tree
  + Find Same Images
  + Experience-Index-OK
  + Font-View-OK


  + Freeware
  + PhotoResizerOK
  + Office.Files.Images
  + Film.Strip.Explorer
  + WinScan2PDF
  + DontSleep
  + ExperienceIndexOK
  + QuickTextPaste
  + DesktopNoteOK
  + ShortDoorNote
  + PAD-s


Home | Thanks | Contact | Link me | FAQ | Settings | Windows 10 | English-AV | Impressum | Translate | PayPal | PAD-s

 © 2025 by Nenad Hrg softwareok.de • softwareok.com • softwareok.com • softwareok.eu


► Difference between intranet and extranet? ◄
► I can't find the autostart entry on Windows 11/10, where is it? ◄
► Is remote support also possible with Window-7 (Starter / Pro)? ◄
► Difference between SQLite and MySQL? ◄


This website does not store personal data. However, third-party providers are used to display ads,
which are managed by Google and comply with the IAB Transparency and Consent Framework (IAB-TCF).
The CMP ID is 300 and can be individually customized at the bottom of the page.
more Infos & Privacy Policy

....