“Rise of OpenGL” and Qt

This post describes my Internet search and findings about OpenGL and other related tools. Post contains excerpts and links from referred websites.

Graphical Kernel System (GKS)

The Graphical Kernel System (GKS) was the first ISO standard for low-level computer graphics, introduced in 1977 [0].

GKS defines a common interface to interactive computer graphics for application programs. GKS has been designed by a group of experts representing the national standards institutions of most major industrialized countries. The full standard provides functional specifications for some 200 subroutines which perform graphics input and output in a device independent way. Application programs can thus move freely between different graphics devices and different host computers. For the first time graphics programs have become genuinely portable [1].


From Wikipedia page of GKS, I found that a descendant of GKS was PHIGS. I explored PHIGS and following is the useful excerpt from Wikipedia page of PHIGS:

PHIGS is an API standard for rendering 3D computer graphics, at one time considered to be the 3D graphics standard for the 1990s. Instead a combination of features and power led to the rise of OpenGL, which became the most popular professional 3D API of the 1990s [2].

PHIGS was designed in the 1980s, inheriting many of its ideas from the Graphical Kernel System of the late 1970s, and became an ANSI (ANSI X3.144-1988), FIPS (FIPS 153) and then ISO standard (ISO/IEC 9592 and ISO/IEC 9593) by 1989. Due to its early gestation, the standard supports only the most basic 3D graphics, including basic geometry and meshes, and only the basic Gouraud, “Dot”, and Phong shading for rendering scenes. Features considered standard today, notably texture mapping, were not supported, nor were many machines of the era physically capable of it (at least in real time).

But PHIGS had its own limitations and given the low performance systems of the era and the need for high-performance rendering, OpenGL was generally considered to be much more “powerful” for 3D programming. PHIGS fell into disuse [2].

Rise of OpenGL

By the early 1990s, SGI was a leader in 3D graphics for workstations. Their IRIS GL API was considered state-of-the-art and became the de facto industry standard, overshadowing the open standards-based PHIGS. This was because IRIS GL was considered easier to use, and because it supported immediate mode rendering. By contrast, PHIGS was considered difficult to use and outdated in terms of functionality [3].

IRIS GL (Integrated Raster Imaging System Graphics Library) was a proprietary graphics API created by Silicon Graphics Inc. (SGI) for producing 2D and 3D computer graphics on their IRIX-based IRIS graphical workstations. Later SGI removed their proprietary code, reworked various system calls, and released IRIS GL as the industry standard OpenGL [5].

You can read the whole history at: http://en.wikipedia.org/wiki/OpenGL#History


OpenGL (Open Graphics Library) is a cross-language, multi-platform API for rendering 2D and 3D computer graphics. The API is typically used to interact with a GPU, to achieve hardware-accelerated rendering. OpenGL was developed by Silicon Graphics Inc. (SGI) from 1991 and released in January 1992 and is widely used in CAD, virtual reality, scientific visualization, information visualization, flight simulation, and video games. OpenGL is managed by the non-profit technology consortium Khronos Group [3].

OS and Platform Independent

In addition to being language-independent, OpenGL is also platform-independent. The specification says nothing on the subject of obtaining, and managing, an OpenGL context, leaving this as a detail of the underlying windowing system. For the same reason, OpenGL is purely concerned with rendering, providing no APIs related to input, audio, or windowing [3].

OpenGL is supported on every major operating system, it works with every major windowing system, and it is callable from most programming languages. It offers complete independence from network protocols and topologies. All OpenGL applications produce consistent visual display results on any OpenGL API-compliant hardware, regardless of operating system or windowing system [4].


Qt it is a cross-platform application and UI framework that is widely used for developing application software with a graphical user interface (GUI), and also used for developing non-GUI programs such as command-line tools and consoles for servers. It has excellent documentation, wiki and learning videos. I would request to readers to please please please see this small video that made me fan of Qt: http://www.youtube.com/watch?v=LPMG4u5e1y8

I quote for Qt as:

Qt is like air, it is everywhere.

Integration of Qt and OpenGL (The Great Combination)

Qt provides support for integration with OpenGL implementations on all platforms, giving developers the opportunity to display hardware accelerated 3D graphics alongside a more conventional user interface [6].

Further I found Qt3D. Qt3D was created to simplify the usage of the OpenGL standard API within a Qt application. Qt3D is a set of C++ APIs for 3D programming built on top of QtOpenGL. QtOpenGL is a port of the OpenGL API to the Qt toolkit. It does a fairly good job at translating all of OpenGL basic functions to a Qt widget. Qt3D is currently available as add-on to basic Qt 5.0 package [] .

Even the essential module Qt Gui in addition to simplify the writing of OpenGL code, also contains a few math classes to aid with themost common mathematical operations related to 3D graphics.

Also from videos section of Qt website, found some very useful videos on Modern Shader based OpenGL techniques and OpenGL with Qt 5.

Moreover, there are number of APIs and glue libraries available for easy and graceful implementation of OpenGL such as following:


At the end, I can conclude that Qt + OpenGL is capable of handling today’s modern and sophisticated 3D graphics for any sort of requirement.

[0] http://en.wikipedia.org/wiki/Graphical_Kernel_System

[1] http://wwwasdoc.web.cern.ch/wwwasdoc/gks_html3/node6.html

[2] http://en.wikipedia.org/wiki/PHIGS

[3] http://en.wikipedia.org/wiki/OpenGL

[4] http://www.opengl.org/documentation/implementations/

[5] http://en.wikipedia.org/wiki/IRIS_GL

[6] http://qt-project.org/doc/qt-4.8/examples-opengl.html

[7] http://qt-project.org/wiki/Introduction-to-Qt3D

Cross section in BRL-CAD

Making a cross-sectional view of a model in BRL-CAD is very easy and fun. All we have to know is just “rt” command and some of its arguments. Following are quick steps to create cross-section of a model:

  1. Open MGED and create / draw model.
  2. Use command saveview fileName  to save the current view of model in a file(shell script).
  3. Run the file generated in step 2 with rt command as:
    sh fileName -s1024 -k 0,-5,0,2000
  4. Step 3 create image in raw format i.e. pix format.
  5. Convert pix image to png as:
    pix-png -s1024 < fileName.pix > fileName.png

The option ‘k’ of “rt” take input as: xdir, ydir, zdir, distance. Here xdir, ydir and zdir define the orientation of cutting plane. The line through Point(xdir, ydir, zdir) is normal to cutting plane. This normal always points away from the space to be subtracted. Since as in 3D geometry, to define a plane we need a normal to that plane. Same is here.

The “distance” is distance of plane from origin. That is, distance specifies position of plane w.r.t. to origin.


We know there are so many users in Ubuntu system other than our sudo account which are not created by us but by system to cater different tasks in the system. Run the command cat /etc/passwd to see all users in the system. One of them is www-data. Whatever you do from browser, it is recorded as work done as www-data. For example, if you create a file from browser, its owner will be www-data. In simple language, browser is www-data user of your system. It is also called Apache user account or webserver account.If you run command, ps -u www-data you will see  number of Apache processes running and their process ids. This command shows all the running processes under a given user. So by checking the processes of the www-data we can conclude that it is Apache’s account. Continue reading www-data

Installing BRLCAD From Source

Finally, I installed BRLCAD from source.


There are two two types of installation and readme files: one for make and other for cmake. Either of two can be used for compilation. Earlier, I did’t know this thing and got confused to follow which file(s).

Since each documentation has full details, so earlier I found it difficult to grasp. I did’t know the significance of “make & cmake utility” and makefiles which made me to read about them too.

Also, by following the documentation and reading from web, I found the sequence of execution of commands as:

sh autogen.sh > ./configure > make > make benchmark > make test > sudo make install

autogen.sh produces configure file. configure create suitable makefiles which are further used by make.

There was minor problem of enabling libpng, which was fixed by me. But the actual problem was of warnings. Sean suggested my the way to pass through warnings. With configure script use option: –disable-strict

Earlier I run configure with option of –enable-optimized. Later, I dropped it also, and finally run configure script as:

./configure –enable-libpng-build –disable-strict

which ran successfully without any error. Later, all commands make, make benchmark, make test, make install run successfully.


Daily Diary: 12, June, 12

Yesterday I was installing BRL-CAD from source but there was problem with using make command and Makefiles. I seek devinder’s help, but she couldn’t do much. Then, I didn’t try it further, rather I started reading about compilation, make and Makefiles.

Later I found that there were patches that were needed to be applied after extracting the compressed tar file. So, I remove all files and folders, re-extract them, and apply patches. But same error occured on running make. Now just dropped the mail to BRLCAD Mailing List and awaiting for their early response.


Compiling BRLCAD From Source

To know what is BRLCAD, please refer to http://brlcad.org/.

As soon as I got this task, I became happy to return to my main project. I thought it was not too difficult to do and really it is not, given that you read their documentation carefully and know the certain commands like make, cmake etc., and certain terms like build, compile, install and their actual sequence and relations with each other.

The actual problem is that number of several documents like README, README.cmake, INSTALL, INSTALL.cmake and many others came along with package. Each of them is in full detail.

I read README, INSTALL and doc/INSTALL.Linux files. Everything goes fine, but then I stuck with problem with “make” command. Frankly, I don’t know actually what make can do, for what purpose it was created. Since as much as I know, it is used to build the system. I requires certain makefiles. But what are these makefiles, I don’ know. So problem is still there. Actually it is not a problem, I pause my work, so that I could proceed after gaining enough knowledge about make.

hmm… today I couldn’t do much work. When returned home, I really feel to be unsatisfied. After compiling it successfully, I will re-post this article with whole procedure and do’s and dont’s.

Presentation on WordPress Plugin

Creating WordPress Plugin: Experience and Efforts

Finally, today I give presentation on “Creating WordPress Plugin”. Actually I was working on project of creating website in WordPress. It is so easy to “Add New Page”,  “Add New Post”, “Add / Install Plugin” etc. So in the whole project I did nothing that suites to CSE / IT student. Rai Sir suggested us (me & Vigas) to start exploring WordPress as developer and learn how to create Plugin. I finished my pending works of this project and started exploring the Internet and http://codex.wordpress.org.

Wrong Approach

Initially I started following a tutorial, in which they created plugin with widget settings but with little description about functions, variables etc. I read it again and again to understand thoroughly, but not satisfied. To get started, I decide to create  a simple plugin, so I copied the code from that tutorial and kept only those basic parts, relevant to my simple plugin. Similarly, I add widget too. This whole process took my lot of effort but with less satisfaction.

Right Approach

Then I come back to main wordpress site. I directly go to “Writing a Plugin” and started reading and exploring more links to function definitions. In this way, I got understanding about the working of functions.

It was in my case that I got link in which much description was not given. It may be possible that one may found a highly informative and descriptive blog  which may act as right approach. for him.

Download my presentation from: Presentation.pdf

Working on Drupal, then WordPress

Drupal and WordPress; A CMS

Drupal and WordPress are famous and widely used open source CMSs (Content Management System) for developing websites. By CMS, we means, a web application that helps to create websites and web applications in an easy way. Lot of developers all over the world are continuously contributing to both these CMSs.

Using a CMS for website developing websites is always a good idea, because of many reasons, some of them as follows:

  • Require less time due to availability of ready made modules and plugins.
  • Secure from hacking attacks due to minimum vulnerability.
  • Reliability because functions used in CMSs (especially the open source) have been tested, used and reviewed by number of developers.
  • Ease of use.

Working with Drupal

We (me and my friend, Vigas) were assigned a task of developing a dynamic website within a very short time. We decided rather from developing it from scratch, we should use a CMS. But both of us had no prior experience of working with any CMS. Rai sir choose Drupal, because he thought that many LUG members already worked on drupal so we could have enough help from them if needed.

Drupal’s Installation is fantastic. It hardly took 10 to 13 minutes to be ready to be used. We started working creating pages, adding blocks and content, installing new themes and modules etc. We could easily change the visibility settings of each page. Large variety of themes and modules are available to choose from.

Reasons for shifting to WordPress

Since Drupal is very vast but still we didn’t found it much useful for our project because of following reasons:

There is no option of editing the content of pages. Our client need the admin control of the website where he wish to make changes according to his requirement. For example drupal has no text editing options while creating pages. On the other hand, WordPress has cool testing processing tools available during new page / post creation.

Secondly, WordPress plugins can be easily installed, activated, used and deactivated whereas Drupal modules require configuration settingsLot of developers all over the world are continuously contributing.

The problem of version incompatibility between latest Drupal installation and modules and themes is there.

Also other features of WordPress like “Preview”, “Drag & Drop feature”, “posts” easy system and appearance appearance settings etc attract us. So we shifted to WordPress.


After shifting to  wordpress, our main motive was to do the work done in Drupal in WordPress. We did more than this in one day. We were impressed by its cool features like drag & drop widgets, easy menu settings, easy text processing tools, options for changing / modifying appearance of whole site without affecting the content of pages and posts.

WordPress plugins helps us in adding more features to our website. They are easy to install, activate and use.

Moreover, I also found that creating a WordPress plugin is very easy and simple task given that you know basics of PHP. WordPress has number of built-in functions that allow the theme / plugin designer to alter the behaviour of you wordpress site or blog.  Also, very good documentation is available on each built-in function, triggers etc.  If you wish to distribute your plugin, WordPress recommend to follow the “WordPress Coding Standards” to avoid any inconsistency.

Working on wordpress project and then developing a simple small plugin I found that wordpress is best place for a user to create websites, who don’t know any web development language and web developer who knows programming well because the open source nature of wordpress allow him to use its functions in his own way. Also the wordpress functions are used and thoroughly revised by web developers throughout the world so they fully secured and reliable.


First week of training

First week: from 14th May to 18th May:

Installed Drupal and started working on drupal. Browse for device independent themes.

Installed BRLCAD.  There was problem of path of BRLCAD. One must give the path: PATH=$PATH:/usr/brlcad/rel-7.10.4/bin in /etc/profile file.

Update UCC Website: Uploaded some UCC files and make changes in some pages and created Ludhiana page.

Upgrading Experimental Server:

I searched the Internet and found the following command for upgrade:

sudo do-release-upgrade -d

First I was trying by using “nohup” and “&” commands to run upgrade at the background, but I failed to bring this process to foreground, hence failed to check its status. So this time experimental server was not upgraded.

Then I used “tmux”. Let me first tell you what is tmux. If need to run a long process over the server and we cannot remain logged in waiting for the process to finish, in this case “tmux” is very useful. With the help of “tmux”, we can run commands, then de-attach the tmux and logout. When we again login and reattach the tmux, we will have the current status of the process (either still running, completed, waiting for user input or an error occurred) .

On checking, I found it was already installed on server. I run the upgrade command,  de attach and then logout. Later, me and navdeep carefully choose the appropriate options and finally the server was upgraded successfully to Ubuntu 12.4 LTS.

For tmux reference, I followed: http://hsrai.wordpress.com/2011/03/26/tmux/

Installing Mail Transfer Agent – Exim4

Download it by following command:

apt-get install exim4  exim4-config

After it, run the following command:

dpkg-reconfigure exim4-config

You will see the ‘Package Configuration’ interface. Here, select the options as mentioned in the following:

  • Choose -> mail sent by smarthost; received via SMTP or fetchmail
  • Type System Mail Name: e.g. gmail.com
  • Type IP Adresses to listen on for incoming SMTP connections:
  • Leave Other destinations for which mail is accepted blank
  • Leave Machines to relay mail for: blank
  • Type Machine handling outgoing mail for this host (smarthost): smtp.gmail.com::587
  • Choose NO, (don’t hide local mail name in outgoing mail).
  • Chose NO, (don’t keep number of DNS-queries minimal (Dial-on-Demand)).
  • Choose mbox
  • Choose NO, (split configuration into small files).
  • Mail for postmaster. Leaving blank will not cause any problems though it is not recommended

Open the file /etc/exim4/exim4.conf.template

Find the line .ifdef DCconfig_smarthost DCconfig_satellite and add the following in that section

       driver = manualroute
       domains = ! +local_domains
       transport = gmail_smtp
       route_list = * smtp.gmail.com

If you have any other smarthost defined with “domains = ! +local_domains” remove that smarthost.

Find begin authenticators. In that section add the following

       driver = plaintext
       public_name = LOGIN
       client_send = : username@gmail.com : YourGmailPassword

Make sure you have no other authenticators with the same public_name (LOGIN). Comment out the whole section in the bottom starting with:

driver = plaintext
public_name = LOGIN

Find the comment transport/30_exim4-config_remote_smtp_smarthost. In that section add

       driver = smtp
       port = 587
       hosts_require_auth = $host_address
       hosts_require_tls = $host_address

Run command:


Restart exim:

/etc/init.d/exim4 restart

Now,to test it follow the instructions:


mail receiver_email_address@example.com

Give a subject and press enter.

Type something and press enter.

Type a single . (dot) and press enter.

Press enter for a blank CC:

That’s it. :-)