Yesterday (Dec 30,2009 ) , I went to pay a visit to my friend (@Alapuzha) to show a set of slides which i developed and named sarcastically as "Financial Accounting in an Hour". After discussing the slides and associated MS Excel files , we together went to his erstwhile math tutor ( during Pre-degree days).
His teacher's name is Pushpan. He works as a middle level officer in the Education department of Kerala. Eventhough he is well into his forties , he is a well built chap and a single hair has not been "greyed" ( i do not know whether it is because of dyeing! ) . I was expecting a Giraffe-Necked lean math teacher and he definitely did not fit into that stereotype.
I narrated about my experience in dabbling with Math over the years in my professional career. (Yes , i have used math extensively in my programming career ). The Discussion drifted to
Vectors as some of my "war stories" were from Computer Graphics Programming.
He explained about Dot Product , Cross Product , Position vector using a device (an All purpose Mathematics board ! ) he designed to demonstrate mathematics related stuff. I got dumbfounded when he explained Vector addition. For the first time , i saw Parellogram law through my eyes.
Then discussion drifted to 3D ( he was speaking from an Engineering drawing perspective ) and issue of co-ordinate system handedness came to the fore. My friend got bored and said what is there in this , it is just a convention. it does not matter much.
I told him .."i know .... you just multiply with COS(180)" ( actually it is COS(180*PI/180))
Pushpan (with a laugh ) told this ..."It is a complicated way to say multiply with -1 to change from one co-ordinate system to another"
To put things in perspective , i explained about how the convention of using left handed system in Microsoft's Direct3D API made the life of many programmers miserable. For those who had a sizeable investment in OpenGL , it was a pain in the ass everywhere. (May be microsoft gained a vast customer base for Direct3D [ in it initial days ..at least..D3D later offered compelling features vis a vis OPenGL ] because of deviating from a de-facto standard at that time... )
using a Sheet of paper , Pushpan ( Math teacher ) explained co-ordinate system convention. He also explained cross product and the "screw story" which every math book tells.
The board he devised has got potential to teach about Vectors , Complex numbers , Circles , Conic sections , Integration (!) you name it. He explained lot of concepts in just half an hour.
He also narrated some of the nice things which he has encountered when he presented this to audience in schools and colleges.
If some one is interested in contacting him for presentations in school and colleges , pls. shoot a mail to me @ praseedp@yahoo.com. He is really a remarkable teacher and a meeting with this guru made a day really memorable for me.
He has done most of his demonstration in and around Alapuzha. I think , we should make him cross to Eranakulam and other districts. He sells that board for around Rs. 900.
Wednesday, December 30, 2009
Tuesday, December 29, 2009
C# on Linux
Last Sunday, While i was traveling by a bus to attend the Cochin ILUG meet , i contemplating about Linux development Model. ( I was reading Art of Unix programming while travelling !)
C# is the solution for many ailments (if at all any ) which Linux Platform suffers from.
Linux do not have a good desktop development language + toolchain. You have got on the one end C/C++ which is not good for application development and On the other side you have got Web Programming/Utilities Programming tools like PHP,Python etc..
I thought of experimenting with C#/Mono on Linux as a desktop application programming language. After writing some command line programs of the console genre and Winforms , i think it holds promise. I need to Explore ADO.net as well to Port an accounting/inventory program which i designed ( coded by my wife ) for our family business ( of selling fire crackers ). I might use a OSI license for releasing the software.
On my Fedora 10 installation , Mono was available @ /usr/lib/mono
To compile a program one can use
mcs ( imagine this is test.cs )
if the program compiled correctly , you will get test.exe
you can run the program using
mono test.exe ( there is an option for Ahead of Time Compilation as well )
I tried couple of Console and and a Winforms program.
To compile Winforms application , i used
mcs -r:System.Windows.Forms.dll WinTest.cs
This will produce WinTest.exe , you can run this using
mono WinTest.exe
C# is the solution for many ailments (if at all any ) which Linux Platform suffers from.
Linux do not have a good desktop development language + toolchain. You have got on the one end C/C++ which is not good for application development and On the other side you have got Web Programming/Utilities Programming tools like PHP,Python etc..
I thought of experimenting with C#/Mono on Linux as a desktop application programming language. After writing some command line programs of the console genre and Winforms , i think it holds promise. I need to Explore ADO.net as well to Port an accounting/inventory program which i designed ( coded by my wife ) for our family business ( of selling fire crackers ). I might use a OSI license for releasing the software.
On my Fedora 10 installation , Mono was available @ /usr/lib/mono
To compile a program one can use
mcs
if the program compiled correctly , you will get test.exe
you can run the program using
mono test.exe ( there is an option for Ahead of Time Compilation as well )
I tried couple of Console and and a Winforms program.
To compile Winforms application , i used
mcs -r:System.Windows.Forms.dll WinTest.cs
This will produce WinTest.exe , you can run this using
mono WinTest.exe
Labels:
GNU Linux Programming
| Reactions: |
Monday, December 28, 2009
Electronics - Will i ever learn about it ?
One of my friend has agreed to teach some electronics to me. He has learned Electronics himself by painstakingly going through the books and by trial and error. He has created some unique gadgets to prove to himself and others ( which includes me ) , that he does know electronics.
We were supposed to start from the first week of December. Due to conflicting schedules , we never could meet to sit together to start the sessions. Last week , i thought that we almost started it. Alas , he had to make a snap chennai visit. Finally , it was agreed that we will meet around 12.00 pm at his residence (at Fort Kochi ) today. I started from Aluva around 10.00 am. The worse thing happen to me was the visit of President of India to Kochi. The vehichles were moving at snail's pace and it took almost two hours to reach North Railway station. We were forced to Cancel the meeting.
I think my "SHAKUN" is not good when i embark on a journey to learn Electronics.
Pls. read my perspective on self study of Electronics
We were supposed to start from the first week of December. Due to conflicting schedules , we never could meet to sit together to start the sessions. Last week , i thought that we almost started it. Alas , he had to make a snap chennai visit. Finally , it was agreed that we will meet around 12.00 pm at his residence (at Fort Kochi ) today. I started from Aluva around 10.00 am. The worse thing happen to me was the visit of President of India to Kochi. The vehichles were moving at snail's pace and it took almost two hours to reach North Railway station. We were forced to Cancel the meeting.
I think my "SHAKUN" is not good when i embark on a journey to learn Electronics.
Pls. read my perspective on self study of Electronics
Labels:
Ways of Life
| Reactions: |
Wednesday, December 23, 2009
Filthy Rich Clients
Ever since my vacation started from August 15th ( Independence day ) , i reduced the frequency of my visits to book stalls. When ever i visit , i will find some goodies. This will be a drain on my reserves and has the potential to reduce my vacation time.
I went to Mindstorm Books to purchase a book on ASP.net for my wife. I purchased a book on how to write a inventory system using Visual Basic ( note :- it is not VB.net ..plain classic VB ) and "Filthy Rich Clients " by Chet Haase and Romain Guy.
The titled fascinated me and i could infer the contents from the title name. But, when i flipped through the pages , i got bowled over.
Some of the cool things covered are
a) Porter and Duff Compositiong Rules ( for Blending )
b) Image Processing
c) Static Effects ( on images and bitmaps )
d) Dynamic Effects
e) How to do 2D animation correctly
f) Animation Transisitions
g) Gradient techniques and Soft Shadows
h) Configuring java2D rendering physical renderer
The good thing about this book is conceptual background for each of the techniques is discussed correctly. This book will be a good addition to your library ( if you have one ) , if you are interested in Computer Graphics using Java ( 90% of the techniques can be easily ported to GDI+ , GD library ).
Highly recommended. At least , i am hooked on to this.
Visit the companion web site @ http://filthyrichclients.org/
I went to Mindstorm Books to purchase a book on ASP.net for my wife. I purchased a book on how to write a inventory system using Visual Basic ( note :- it is not VB.net ..plain classic VB ) and "Filthy Rich Clients " by Chet Haase and Romain Guy.
The titled fascinated me and i could infer the contents from the title name. But, when i flipped through the pages , i got bowled over.
Some of the cool things covered are
a) Porter and Duff Compositiong Rules ( for Blending )
b) Image Processing
c) Static Effects ( on images and bitmaps )
d) Dynamic Effects
e) How to do 2D animation correctly
f) Animation Transisitions
g) Gradient techniques and Soft Shadows
h) Configuring java2D rendering physical renderer
The good thing about this book is conceptual background for each of the techniques is discussed correctly. This book will be a good addition to your library ( if you have one ) , if you are interested in Computer Graphics using Java ( 90% of the techniques can be easily ported to GDI+ , GD library ).
Highly recommended. At least , i am hooked on to this.
Visit the companion web site @ http://filthyrichclients.org/
Labels:
Books,
Computer Graphics
| Reactions: |
Tuesday, December 22, 2009
DirectX 11 on Vista
Windows 7 comes bundled with DirectX 11 . There are not much GPUs which support Shader Model 5 are available ( at this point of time) . In a matter of six months cards will appear . I think ATI has got a DirectX 11 card.
I am having a laptop ( Dell inspiron 1520 which has got Windows Home Edition pre installed ) which has got a card which is shader model 4.0 compatible (directx 1o.1 compatible NVIDIA GeForce 8600 GT ) . Dell maintains that Dell inspiron is not Windows 7 compatible.
To learn DirectX 11 API , i need to install DirectX 11 on Vista
Here is what i did
a) Installed Windows Vista SP1
b) Installed Windows Vista SP2
c) Installed an update ((KB971512) ) by going to
http://www.microsoft.com/downloads/details.aspx?FamilyId=e1199d12-5b23-4769- b1e0-210ee147ce15&displaylang=en
d) Install August 2009 DirectX SDK from
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=b66e14b8-8505-4b17-bf80-edb2df5abad4
The download is 554 MB file. It took five hours to download.... i tweeted a lot because of this
Now all the DirectX 11 samples are running correctly ( albiet in a slow manner )
I am having a laptop ( Dell inspiron 1520 which has got Windows Home Edition pre installed ) which has got a card which is shader model 4.0 compatible (directx 1o.1 compatible NVIDIA GeForce 8600 GT ) . Dell maintains that Dell inspiron is not Windows 7 compatible.
To learn DirectX 11 API , i need to install DirectX 11 on Vista
Here is what i did
a) Installed Windows Vista SP1
b) Installed Windows Vista SP2
c) Installed an update ((KB971512) ) by going to
http://www.microsoft.com/downloads/details.aspx?FamilyId=e1199d12-5b23-4769- b1e0-210ee147ce15&displaylang=en
d) Install August 2009 DirectX SDK from
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=b66e14b8-8505-4b17-bf80-edb2df5abad4
The download is 554 MB file. It took five hours to download.... i tweeted a lot because of this
Now all the DirectX 11 samples are running correctly ( albiet in a slow manner )
Labels:
Direct3D/XNA
| Reactions: |
Saturday, December 05, 2009
What is Renderman ?
Renderman is an API specification developed by Pixar animation studios for it's REYES ( Rendering Everything You Ever Saw ) algorithm. The REYES renderer was meant for creating
photorealistic scenes to be used by the Movie and the animation industry. The architecture of REYES is different from realtime pipeline based renderers like OpenGL and Direct3D. The concept of shading language ( stanford shade trees ) became a commercial reality because of the Renderman API. The Pixar's implementation of RenderMan API is called PR Man ( or Photo Realistic Renderman ). Most of the offline renderers now a days support Renderman interface ( a text file called RenderMan Interface Byte stream ) or a look alike standard. One can create different shaders like surface shader , light shader , image shader , displacement shader to create variety of effects. Procedural techniques through RSL ( Renderman Shading Language ) makes Renderman standard a powerful API.
Renderman compliant renderers can be used as a plug in to commercial modelling packages like
3DS Max , Maya , Soft Image XSI or blender . The advantage is programmability you get through Renderman Shading language ( There is subtle difference of semantics between RSL and real time shading languages [ like CG,HLSL and GLSL ] ). The Open source PBRT renderer has got a scene description language similar to Renderman. The implementation of PBRT is chronichled in a book by it's implentors.
Advanced Renderman by T0ny Apodaca and Larry Gritz is a book which every person planning to work with Renderman API should possess.
Pixie and Aqsis are two Open source renderman API compliant renderers out there. I have used Aqsis for learning from the Tony apodaca book.
Search for Renderman and RSL page on the wikipedia to learn more about Renderman API.
Modern Renderman API compliant renderers go beyong REYES by providing Radiosity , Photon Mapping and MLT rendering techniques.
photorealistic scenes to be used by the Movie and the animation industry. The architecture of REYES is different from realtime pipeline based renderers like OpenGL and Direct3D. The concept of shading language ( stanford shade trees ) became a commercial reality because of the Renderman API. The Pixar's implementation of RenderMan API is called PR Man ( or Photo Realistic Renderman ). Most of the offline renderers now a days support Renderman interface ( a text file called RenderMan Interface Byte stream ) or a look alike standard. One can create different shaders like surface shader , light shader , image shader , displacement shader to create variety of effects. Procedural techniques through RSL ( Renderman Shading Language ) makes Renderman standard a powerful API.
Renderman compliant renderers can be used as a plug in to commercial modelling packages like
3DS Max , Maya , Soft Image XSI or blender . The advantage is programmability you get through Renderman Shading language ( There is subtle difference of semantics between RSL and real time shading languages [ like CG,HLSL and GLSL ] ). The Open source PBRT renderer has got a scene description language similar to Renderman. The implementation of PBRT is chronichled in a book by it's implentors.
Advanced Renderman by T0ny Apodaca and Larry Gritz is a book which every person planning to work with Renderman API should possess.
Pixie and Aqsis are two Open source renderman API compliant renderers out there. I have used Aqsis for learning from the Tony apodaca book.
Search for Renderman and RSL page on the wikipedia to learn more about Renderman API.
Modern Renderman API compliant renderers go beyong REYES by providing Radiosity , Photon Mapping and MLT rendering techniques.
Labels:
Computer Graphics - BarCamp 7
| Reactions: |
Tuesday, December 01, 2009
How do i take the Negative of a image ?
In my previous post , i wrote about color to grey scale conversion. These techniques are called Image Point Processing. That means , the processing algorithms look pixels individually. There is immense scope for Parallelism here. Ray Tracing is another area where this kind of Data Parallelism exists (embarassing parallelism).
The algorithm can be summed up in one sentence...
"Subtract R,G,B of the pixels from 255 and set it back.."
The Psuedo code is as follows
IMG m = LoadImage(filename); // can be .TGA,.BMP,.JPG or GIF
int rows = m.GetRows();
int cols = m.GetCols();
for i= 0 to rows -1
for j = 0 to cols -1
RGB r = GetPixel( i , j );
RGB temp;
temp.R = 255 - r.R;
temp.G = 255 - r.G;
temp.B = 255 - r.B;
SetPixel(i,j,temp)
Next j
Next i
I have written a C# program to demonstrate this. The code listing will be long ... ( most of the code are infrastructural ) .. interested parties can shoot a mail to praseedp@yahoo.com. ( I will be discussing this and show the source at the BarCamp 7 event )
The algorithm can be summed up in one sentence...
"Subtract R,G,B of the pixels from 255 and set it back.."
The Psuedo code is as follows
IMG m = LoadImage(filename); // can be .TGA,.BMP,.JPG or GIF
int rows = m.GetRows();
int cols = m.GetCols();
for i= 0 to rows -1
for j = 0 to cols -1
RGB r = GetPixel( i , j );
RGB temp;
temp.R = 255 - r.R;
temp.G = 255 - r.G;
temp.B = 255 - r.B;
SetPixel(i,j,temp)
Next j
Next i
I have written a C# program to demonstrate this. The code listing will be long ... ( most of the code are infrastructural ) .. interested parties can shoot a mail to praseedp@yahoo.com. ( I will be discussing this and show the source at the BarCamp 7 event )
Labels:
Computer Graphics - BarCamp 7
| Reactions: |
How do i convert a Color image to Gray scale ?
Most of the image processing algorithms work well on grey scale image. Some time , we need to convert a Color image to it's grey scale equivalent. NTSC ( National Telivision Standards Comittee )
defines the follow formula
To convert a RGB pixel ( given as R , G, B ) to it's Grey scale value This is what wikipedia says
"To convert any color to a grayscale representation of its luminance, first one must obtain the values of its red, green, and blue (RGB) primaries in linear intensity encoding, by gamma expansion. Then, add together 30% of the red value, 59% of the green value, and 11% of the blue value (these weights depend on the exact choice of the RGB primaries, but are typical). Regardless of the scale employed (0.0 to 1.0, 0 to 255, 0% to 100%, etc.), the resultant number is the desired linear luminance value; it typically needs to be gamma compressed to get back to a conventional grayscale representation."
I am ignoring Gamma Correction in this discussion...
grey = R*0.3 + G*0.59 + B*0.11
SET RGB = { grey, grey,grey }
The Psuedo code is
for i= 0 to rows -1
for j = 0 to cols -1
RGB r = GetPixel( i , j );
grey = r.R*0.3 +r. G*0.59 + r.B*0.11
RGB temp;
temp.R = r.R;
temp.G = r.G;
temp.B = r.B;
SetPixel(i,j,temp)
Next j
Next i
I have written a C# program to demonstrate this. The code listing will be long ... ( most of the code are infrastructural ) .. interested parties can shoot a mail to praseedp@yahoo.com. ( I will be discussing this and show the source at the BarCamp 7 event )
defines the follow formula
To convert a RGB pixel ( given as R , G, B ) to it's Grey scale value This is what wikipedia says
"To convert any color to a grayscale representation of its luminance, first one must obtain the values of its red, green, and blue (RGB) primaries in linear intensity encoding, by gamma expansion. Then, add together 30% of the red value, 59% of the green value, and 11% of the blue value (these weights depend on the exact choice of the RGB primaries, but are typical). Regardless of the scale employed (0.0 to 1.0, 0 to 255, 0% to 100%, etc.), the resultant number is the desired linear luminance value; it typically needs to be gamma compressed to get back to a conventional grayscale representation."
I am ignoring Gamma Correction in this discussion...
grey = R*0.3 + G*0.59 + B*0.11
SET RGB = { grey, grey,grey }
The Psuedo code is
for i= 0 to rows -1
for j = 0 to cols -1
RGB r = GetPixel( i , j );
grey = r.R*0.3 +r. G*0.59 + r.B*0.11
RGB temp;
temp.R = r.R;
temp.G = r.G;
temp.B = r.B;
SetPixel(i,j,temp)
Next j
Next i
I have written a C# program to demonstrate this. The code listing will be long ... ( most of the code are infrastructural ) .. interested parties can shoot a mail to praseedp@yahoo.com. ( I will be discussing this and show the source at the BarCamp 7 event )
Labels:
Computer Graphics - BarCamp 7
| Reactions: |
Subscribe to:
Posts (Atom)