Book Image

OpenGL Data Visualization Cookbook

Book Image

OpenGL Data Visualization Cookbook

Overview of this book

OpenGL is a great multi-platform, cross-language, and hardware-accelerated graphics interface for visualizing large 2D and 3D datasets. Data visualization has become increasingly challenging using conventional approaches as datasets become larger and larger, especially with the Big Data evolution. From a mobile device to a sophisticated high-performance computing cluster, OpenGL libraries provide developers with an easy-to-use interface to create stunning visuals in 3D in real time for a wide range of interactive applications. This book provides a series of easy-to-follow, hands-on tutorials to create appealing OpenGL-based visualization tools with minimal development time. We will first illustrate how to quickly set up the development environment in Windows, Mac OS X, and Linux. Next, we will demonstrate how to visualize data for a wide range of applications using OpenGL, starting from simple 2D datasets to increasingly complex 3D datasets with more advanced techniques. Each chapter addresses different visualization problems encountered in real life and introduces the relevant OpenGL features and libraries in a modular fashion. By the end of this book, you will be equipped with the essential skills to develop a wide range of impressive OpenGL-based applications for your unique data visualization needs, on platforms ranging from conventional computers to the latest mobile/wearable devices.
Table of Contents (16 chapters)
OpenGL Data Visualization Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Installing the GLFW library in Windows


There are two ways to install the GLFW library in Windows, both of which will be discussed in this section. The first approach involves compiling the GLFW source code directly with CMake for full control. However, to simplify the process, we suggest that you download the precompiled binary distribution.

Getting ready

We assume that you have successfully installed both Visual Studio 2013 and CMake, as described in the earlier section. For completeness, we will demonstrate how to install GLFW using CMake.

How to do it...

To use the precompiled binary package for GLFW, follow these steps:

  1. Create the C:/Program Files (x86)/glfw-3.0.4 directory. Grant the necessary permissions when prompted.

  2. Download the glfw-3.0.4.bin.WIN32.zip package from http://sourceforge.net/projects/glfw/files/glfw/3.0.4/glfw-3.0.4.bin.WIN32.zip and unzip the package.

  3. Copy all the extracted content inside the glfw-3.0.4.bin.WIN32 folder (for example, include lib-msvc2012) into the C:/Program Files (x86)/glfw-3.0.4 directory. Grant permissions when prompted.

  4. Rename the lib-msvc2012 folder to lib inside the C:/Program Files (x86)/glfw-3.0.4 directory. Grant permissions when prompted.

Alternatively, to compile the source files directly, follow these procedures:

  1. Download the source package from http://sourceforge.net/projects/glfw/files/glfw/3.0.4/glfw-3.0.4.zip and unzip the package on the desktop. Create a new folder called build inside the extracted glfw-3.0.4 folder to store the binaries.and open cmake-gui.

  2. Select glfw-3.0.4 (from the desktop) as the source directory and glfw-3.0.4/build as the build directory. The screenshot is shown as follows:

  3. Click on Generate and select Visual Studio 12 2013 in the prompt.

  4. Click on Generate again.

  5. Open the build directory and double-click on GLFW.sln to open Visual Studio.

  6. In Visual Studio, click Build Solution (press F7).

  7. Copy build/src/Debug/glfw3.lib to C:/Program Files (x86)/glfw-3.0.4/lib.

  8. Copy the include directory (inside glfw-3.0.4/include) to C:/Program Files (x86)/glfw-3.0.4/.

After this step, we should have the include (glfw3.h) and library (glfw3.lib) files inside the C:/Program Files (x86)/glfw-3.0.4 directory, as shown in the setup procedure using precompiled binaries.