TechSpace

25 Articles

The Bumblebee Project

What is the Bumblebee project?

The Ubuntu Wiki has a better explanation:

“Bumblebee aims to provide support for NVIDIA Optimus laptops for GNU/Linux distributions. Using Bumblebee, you can use your NVIDIA card for rendering graphics which will be displayed using the Intel card.Bumblebee is officially supported by Ubuntu in 14.04 newer. However, all releases are supported by the Bumblebee Project community from Ubuntu version 12.04 up to 14.04.”

I came across this while searching a driver for my graphics card.  I’m using a DELL laptop with a hybrid graphics card – NVIDIA GeForce GT 525M.  I found no satisfactory drivers in the linux(Ubuntu) platform that works perfectly.  Even though I tried configuring with different versions of NVIDIA Drivers for Ubuntu, the libGL.so module was always crashing when the application loads.  I setup bumblebee, and it worked.

Click here for the instructions to setup graphics cards for your NVIDIA Optimus laptops with Linux(Ubuntu distribution)

After configuration, use the optirun command to run the application with the NVIDIA card,

optirun ./myapp

To test it, install glmark2 which is a benchmarking tool for Opengl.

sudo apt-get install glmark2

After successful installation, run the command in the terminal,

optirun glmark2

It will show up the details of the graphics card and performs various tests along with preview.

screenshot-from-2016-12-20-234012 screenshot-from-2016-12-20-234134

Blender Coordinate System to OpenGL

Some simple transformations may require when we import a 3d model from a modeling package which uses different coordinate system than the 3D engine we use.   Though both Blender and OpenGL use right handed coordinate system,  Blender is designed to have its z axis point upwards.  So if we import a 3d model which is created in Blender with its height along Z axis, the model seem to aligned with the view direction if we try to draw it in OpenGL with the default model, projection transformations.  We need to apply some rotations, translations as well as some vertex reordering to make the geometry visually appear similar to where we have created it.

I hope Blender has its coordinate system pretty hard coded into this.  And I found this question in a few game development forums asking for a solution.

Coordinate System

Differences in Axis orientations in both Blender and OpenGL.

 

 

Read More →

Writing a scene exporter addon for Blender

This tutorial will explain how to pull the scene data(meshes, lights, cameras, animations) from Blender and dump them into a desired file format for our use.  This is what every addon in the Blender does.  This article emphasize more on how to read the required data from blender scene, not how exactly the procedures to put them into an addon.

Blender Exporter Menu

First of all, Blender is a 3D modeling/animation platform is built using C++ and Python.  Python is used for extending its existing functionalities and is released as the Blender-Python API.  It can be found here.

Read More →

Dos mode graphics

In old days, when MS-DOS was one of the prominent operating systems, there were no high performance graphic systems as today’s. I recall the time when I had to work with the BGI(egavga.bgi) graphics under dos. But the kind of graphics operations we can do was somehow limited to some extend. In such cases game programmers make use of the freedom of directly accessing the video memory which was a possible thing under MS-DOS. To do something like this, what we really do is, switch into a desired display mode using bios interrupts, where a display mode is designated by screen width in pixels, screen height in pixels and number of bits per pixel.

Accessing the video memory

The video memory is a designated memory location to write all the visual data into.  Whatever content written into it will be interpreter by the display driver based on the current display mode set.   A display mode is a combination of the parameters such as screen width, height and bits per pixel. Screen width and height is measured in the number of pixels horizontally and vertically.  Bits per pixels is the number of bits required to represent a single pixel.  Using this, we can calculate the number of bytes required for representing a single frame.

Video Memory(in bytes) = width x height x bits per pixel / 8

And we can define a SetPixel(x, y, color) function just like this,

void SetPixel(int x, int y,  int color)
{
    pVidMemory[y * screen_width + x] = color;
}

Similarly, a GetPixel(x, y) function can be define like,

int GetPixel(int x, int y)
{
   return  pVidMemory[y * screen_width + x];
}

In the above code snippet, data type int has 16 bits and 16 bits represents a color.  pVidMemory is a int pointer(int*) set to the starting location of the display memory. Each location in this array represents one pixel on the screen. Assigning color values to the array locations will make the corresponding pixel appear in that color.

Using this approach,  one can get more control over the rendering pipeline and can implement a back buffer – front buffer rendering system. In such a system, all the drawings will happen in the backbuffer and it will be copied to the display buffer so users can see the frame. Back buffers are commonly used to avoid users see the ugly flickering when individual elements are drawn in the active view one after the other.

When Windows operating system has evolved, Microsoft defined new way of doing things. They brought GDI and later the high performance DirectX interfaces. OpenGL came and it has became an industry standard for computer graphics.

Blender Animation Timeline Units

Couple of days ago, I received some mail from a friend asking some doubts regarding the Blender Timeline and its time units.    He was trying to relate between the numbers in the Timeline and the time units in the exported animation file(in Collada format).  After listening to his query, I was glad that I solved that long time back itself, it was to import skeletel animation from a collada file exported from Blender.  If you don’t know that the Blender timeline has frame numbers, it can be a little bit confusing and misleading.  The exported Collada file has them in seconds represented by floating point numbers.  The question of how to convert the frame numbers to time has a simple and straight forward answer.

The Blkender timeline

Blender timeline

Read More →

Doxygen

doxygen-logoDoxygen is a cross platform tool for generating documentation from sourcecodes of programming languages like C, C++, Objective-C, C#, Java, PHP, Phython, IDL, Fortran, VHDL etc. It can generate an online documentation browser as well as support generating output in RTF, compressed HTML and unix man pages.

Homepage: http://doxygen.org

OpenOffice

open-office-logoApache OpenOffice is an alternative for Microsoft Office Package. The default format of OpenOffice is known as the Open Document Format(ODF) which is and ISO/IEC standard, also it supports a wide variety of formats that Microsoft Office supports.  The package contains the following software,

Writer(Word)

Calc(Excel)

Impress(Power Point)
Base(Access)
Draw
Math

 

Homepage: http://www.openoffice.org/

Audacity

audacity-logoAudacity is a cross platform audio editing tool whose first version released in year 2000. It runs in Windows, Mac, Linux as well as unix. The tool support basic audio editing also many effect audio filter plugins. If you are a programmer, if you wish to know what is happening behind a particular audio effect, you can get the source code and analyze it, just like I do. That’s one of the reason I’m loving this much.

Homepage: http://audacity.sourceforge.net/

print ''; /** lol **/