Log in or register to post comments

3D model moving along with camera

September 11, 2013 - 8:54pm #4

Hi,

In ImageTarget , I have replaced the teapot with Cube(60 * 60 * 20).

Basically model should remain on top of tracker irrespective of camera movement.

But when i moved left or right the model appear to move towards camera.

I tried to translate the modelviewmatrix as,

Utils::translatePoseMatrix(jObject_centerX, jObject_centerY, jObject_centerZ, &modelViewMatrix.data[0]);   

but still cube is moving.

 

This is the relevant code -

 

       Utils::translatePoseMatrix(jObject_centerX, jObject_centerY, jObject_centerZ, &modelViewMatrix.data[0]);   
        Utils::rotatePoseMatrix(90,1,0,0,&modelViewMatrix.data[0]);
        Utils::rotatePoseMatrix(-90,0,1,0,&modelViewMatrix.data[0]);
        Utils::scalePoseMatrix(kObjectScale, kObjectScale, kObjectScale, &modelViewMatrix.data[0]);
        Utils::multiplyMatrix(&projectionMatrix.data[0], &modelViewMatrix.data[0] , &modelViewProjection.data[0]);

 

Thanks

 

 

 

3D model moving along with camera

September 12, 2013 - 12:36am #3

Could you share a video describing the issue you observe ?

 

3D model moving along with camera

September 12, 2013 - 8:42pm #2

Thanks, the issued is solved.

I did -

Utils::translatePoseMatrix(0, 0, jObject_centerZ, &modelViewMatrix.data[0]);  

3D model moving along with camera

September 13, 2013 - 4:15am #1

Good to hear.

Log in or register to post comments