Eclipse, Java Microediton, Android, Nokia, and etc.
This blog will be associated with eclipse, Java Micro Edition, Android, etc... My premiere blogging date began from March, 25th, 2009
2/20/2015
8/31/2011
7/13/2011
Install MAC OS on my desktop.
9/10/2010
What I am doing now?
It is a good chance to candidates who may learn about 3D graphic tools without any payment.
There are many free 3D graphic tools, such as, Google Sketch up, Blender, K3D, MeshLab, etc.
There is one more tool called Truespace which I recently have installed on my desktop. I could draw simple model mush easier.
And of course, I could get the model values using collada dae file format which is xml based text. The above shown picture is a simple plane map editer shows plane lands and fast speed of FPS, etc.
7/30/2010
Drawing ground with texture.
7/17/2010
Here is no activity for a long time!
This post has not a special content. I wish continue my activity which is related with mobile application development.
I am still using old laptop note book and the new desktop which i was bought recently is next with my laptop note book. The desktop run so fast and has more screen capacity. Run to make my new application....
8/18/2009
Creating 3d data values for drawing ground
To create 3d data values for drawing ground have to calculate from center (0f, 0f, 0f). The left picture shows the four parts which are divided by center.
Every x and y values are increased and decreased by 1.0 or -1.0 except z values. The increase and decrease values have a same pattern. According many OpenGL examples from Internet, we can draw rectangle with 4 vertex points. Each vertex point has x, y and z value. Therefore, the program has to generate rectangle points’ value. Of course, the generated file has also color values.
int main(int argc, char **argv)
{
int nwidth = atoi(argv[1]);
int nheight = atoi(argv[2]);
fnCVertextFile(nheight, nwidth);
}
Example) program 8 8
When the program was executed like an example, then the vector values will be generated 16 * 16 sizes.
typedef struct {
float x, y, z;
} M3DPoint;
typedef struct {
M3DPoint left, top, right, bottom;
} M3DRect;
// the function writes structure values and string values to file.
void fprintfex(FILE *fvfile, M3DRect row1, char *value)
{
fprintf(fvfile, "%f %f %f %s\n", row1.left.x, row1.left.y, row1.left.z, value);
fprintf(fvfile, "%f %f %f %s\n", row1.top.x, row1.top.y, row1.top.z, value);
fprintf(fvfile, "%f %f %f %s\n", row1.right.x, row1.right.y, row1.right.z, value);
fprintf(fvfile, "%f %f %f %s\n", row1.bottom.x, row1.bottom.y, row1.bottom.z, value);
}
void fnCVertextFile(int aRow, int aColumn)
{
M3DRect row1;
float nleft = 0.0f;
float ntop = 0.0f;
char value1[] = {"0.3 0.3 0.3"};
char value2[] = {"0.5 0.5 0.5"};
char *value;
bool toggle = false;
FILE *fvfile = fopen("vector.dat", "w");
if(fvfile == NULL) {
printf("file cannot open!\n");
exit(-1);
}
// count of vertex
fprintf(fvfile, "%d\n", aRow * aColumn * 4 * 4);
for(int j = 0; j < aRow; j++)
{
for(int i = 0; i < aColumn; i++)
{
row1.left.x = nleft; row1.left.y = ntop; row1.left.z = 1.5f;
row1.top.x = nleft+1.0f; row1.top.y = ntop; row1.top.z = 1.5f;
row1.right.x = nleft+1.0f; row1.right.y = ntop+1.0f; row1.right.z = 1.5f;
row1.bottom.x = nleft; row1.bottom.y = ntop+1.0f; row1.bottom.z = 1.5f;
value = (toggle) ? value1 : value2;
fprintfex(fvfile, row1, value);
toggle = !toggle;
nleft += 1.0f;
}
ntop += 1.0f;
nleft = 0.0f;
toggle = !toggle;
}
// was ommited below section of source
…
Subscribe to:
Posts (Atom)