2/29/2008

I study a template feature in stl

I study a template feature.

Sizeof standard function accepts Typename.

For example


template < typename TYPE >void test(void){
cout << sizeof(TYPE) << endl;
}


It's very usefull.

2/26/2008

transform in stl with gcc4.0.3

I try to complie next code with gcc 4.0.3


#include < iostream >
#include < string >
#include < algorithm >
#include < cctype >
using namespace std;

int main(void)
{
string tmp("ABC");
cout << tmp << endl;
transform(tmp.begin(),
tmp.end(),
tmp.begin(),
tolower);
cout << tmp << endl;
return 0;
}


GCC can not accept above codes, compile error happens.

Becuase "tolower" function is not certain type.

So I builded wrapper function of tolower, Compile is succeed.

My way to throw exception

When I was programming, My writing codes always throw a exception of string type.

Because This way is easy for me, I can not suffer from building a mechanism of exception.

It is important for me that entirety of flow is finished quickly.

I can see big miss, If program flowed between end from start.

So I want to finish quickly.

2/24/2008

My open source have new feature


I finished to implements loading diffuse color from 3ds file.

If bugs rest yet...

This picture is 3d model with diffuse color from 3ds file.

2/20/2008

First touch stack in stl

I first use stack template in the standard template.

It's very usefull.

Push , pop and top methods are very simple.

Following code is my sample

#include <iostream>
#include <stack>
using namespace std;

int main(void)
{
stack<int> datas;// It's that stack contents are dequeue.
datas.push(0x01);
datas.push(0x10);
while( !datas.empty() ){
cout << datas.top() << endl;
datas.pop();
}
return 0;
}

2/18/2008

Cost about normalize normal vector

I read Beginning OpenGL game programming, it tell me that to set GL_NORMALIZE cause normalizing calculate per every frame.

This book also written that if you are scaling equally in all three dimentions then you can use GL_RESCALE_NORMAL extract the scale factor from modelview matrix alternative GL_NORMALIZE.

I understood that my approach costs in every frame, and good way is two vertices arraies.

2/17/2008

Scaling to separate axis.


StripExperiment, is my open source, could have new feature.

It is scaling along each x, y, z axis separately.

Thus, user view thin 3d model more particularly than before version.

2/14/2008

I try to use Google SpreadSheets

I heared anounce from google, it's that Google SpreadSheats could have new features.

Thus, today I try Google SpreadSheats.

Graph and copy and paste column features are very good!

I guess otherwise features is usefull.

Aftertime I will use Google SpreadSheats little by little.

2/13/2008

I am worry about cost computing normalize.

I want to equip new feature scaling along three axis separatly, thus I use glScaled API, then glEnable(GL_NORMALIZE) together.

I am worry about cost computing normalize at normal vectors.

How to transform from mouse click point to 3d world.

I study way to transform from mouse click point in the screen coordinate to virtual 3d world coordinate.

Of course, use OpenGL.

I googled key words,catched usefull API.

It's glReadPixels and glUnProject, To use glReadPixels with specified GL_DEPTH_COMPONENT format gives me depth value, and depth value and x,y in screen coordinate transform to 3d world coordinate by calling glUnProject.

2/05/2008

PulseAudio

Now, My machines, desktop and laptop, are installed Ubuntu 7.04.

Ubuntu 8.04 have new features are Gnome System Monitor, new Xorg, Brasero and so on.

But, PulseAudio that is one of new features make me in trouble.

I have programed with alsa library, thus error happens.

2/04/2008

My favorite softs in Ubuntu

My favorite softs are Emacs , Gimp, RealPlayer and so on.

Emacs is required to edit source code and to type shell and so on.
Everything to type command is done in Emacs.

I draw a pciture and create simple picture file in Gimp.

RealPlayer is need in order to listen music and see movie.
In Ubuntu 6.04, There is bug to start RealPlayer.
In now version, the bug disappeared.

I thank developer.

2/03/2008

L'Arc en ciel's music "Shine"

I like L'Arc en ciel music.

Shine is new song, but yet this song is not released.

I want this song will be released as early as possible.

2/02/2008

I study frequency of music scale

In music scale, Each frequency is calculated by criterion of music scale's frequency.

Criterion of music scale's frequency is 440Hz, it is heard as ra.
Calculating rule is criterion times special value, it is the twelve power of two.

Since, do is one of music scale is 440Hz times special value times 3.

2/01/2008

Frequency correspond with music scale

I study frequency of musci scale.

I get next corresponding table.

do = 220.0
re = 246.942
mi = 277.183
fah = 293.665
sol = 329.628
lah = 369.994
si = 415.305
do = 440.0