Hi,
i use opengl es library on symbian. And i have two problems at opengl es . i try to draw a cube on special postion. so i got the axis X,Y,Z, and movement vectors.
- i want to use the function LoadMatrixf. The codes follows :
GLfloat gl_para[16]={0.998029,0.017969,0.060119,0.0,
0.019204,-0.999615,-0.020033,0.0,
0.059735,0.021148,-0.997990,0.0,
4.988117,-2.675533,161.780807,1.0};
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf(gl_para);
DrawBox( 15.f, 15.f, 15.f ); //some functions used to draw a cube
but the cube disappeared, there is nothing.
when i use these codes:
GLfloat gl_para[16]={1.0f,0.0f,0.0f,0.0f,
0.0f,1.0f,0.0f,0.0f,
0.0f,0.0f,1.0f,0.0f,
0.0f,0.0f,0.0f,1.0f};
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf(gl_para);
DrawBox( 15.f, 15.f, 15.f );
it works. i know it’s equal to glLoadIdentity(),
but when i use my Matrix, it dosen’t work. why?
i think the matrix is right.
The direction of X axis is (0.998029,0.017969,0.060119,0.0), Y is (0.019204,-0.999615,-0.020033,0.0)and Z is (0.059735,0.021148,-0.997990,0.0). The movement is (4.988117,-2.675533,161.780807,1.0). The axis X,Y,Z are normal axis. i think they are right. but why didn’t it work? could you give me some example datas as parameter in function glLoadMatrix so i can try to test.
- i try to draw a cube on a picture. i want to draw it on special postion on the picture. could you give me some suggestions? Actually, i captured a picture by camera. There is a special mark in the picture. And i want to detect the mark and draw a cube on the mark. So i get the direction of camera in according with the mark. That is the GLfloat gl_para[16], i got the axis X, Y,Z, and the movement vetors which are mentioned in above threads. That what i want to do. Now, i have got the gl_para, and i want to use glLoadMatrix to result it. So what can i do? how to draw a cube on a picture?