Log in or register to post comments

How to get camera view vector / lookat vector

September 6, 2013 - 1:12am #1

Hi,

How to get the camera view / lookat vector w.r.t. tracker and 3d model render on it.

I need to find the lookat vector w.r.t. to 3d object when it is translated away from tracker.

 

 

Thanks

How to get camera view vector / lookat vector

September 13, 2013 - 4:12am #11

Make sure that the model normal is defined in the same reference frame (i.e. the reference frame of the model) and that the 2 vectors are normalized, if needed.

 

How to get camera view vector / lookat vector

September 13, 2013 - 1:58am #10

I want to find the dot product of camera look at vector and normal to 3D model.

I have calculated normal to 3D model and camera lookat vector from above, but not getting the expected result.

Do i need to modify the camera vector ?

How to get camera view vector / lookat vector

September 12, 2013 - 12:37am #9

You're welcome.

How to get camera view vector / lookat vector

September 11, 2013 - 8:42pm #8

Thanks

How to get camera view vector / lookat vector

September 10, 2013 - 12:22am #7

If you need to take into account the 3D model translation from the center of the trackable, you can modify the code as follows:

const QCAR::TrackableResult* result = state.getTrackableResult(tIdx);
const QCAR::Trackable& trackable = result->getTrackable();
QCAR::Matrix44F modelViewMatrix = QCAR::Tool::convertPose2GLMatrix(result->getPose());

// Add this line to take into account 3D model translation from trackable center
float my_translation_x = 10.0f;
SampleUtils::translatePoseMatrix(my_translation_x, 0.0f, 0.0f,
                                         &modelViewMatrix.data[0]);

QCAR::Matrix44F inverseMV = SampleMath::Matrix44FInverse(modelViewMatrix);
QCAR::Matrix44F invTranspMV = SampleMath::Matrix44FTranspose(inverseMV);

where the my_translation_x is just an example of translation along the X-axis of the trackable (you can then use your own custom values, along X, Y and Z)

 

How to get camera view vector / lookat vector

September 10, 2013 - 12:08am #6

Thanks for so quick reply.

Correct me if I am wrong , I am new to this enenvironment--

But camera viewing direction is w.r.t. to tracker , what if I translate the model far from tracker then :

1)  angle between camera vector and center of model

2) angle between camera vector and center of tracker

are different .

I want to find the camera vector looking toward model not tracker.

 

Thanks

How to get camera view vector / lookat vector

September 9, 2013 - 11:10pm #5

You can definitely use that link:

https://developer.vuforia.com/resources/dev-guide/getting-camera-position

which actually explains what I was referring to and provides you the exact steps and code snippets; in particular, the camera viewing direction is the vector that you are looking for.

 

How to get camera view vector / lookat vector

September 9, 2013 - 9:28pm #4

Hi,

Did you mean that we should multiply (0,0,1) with inverse of modelViewMatrix (ImageTarget) to get  camera lookat vector w.r.t. rendered model ?

From the below link

https://developer.vuforia.com/resources/dev-guide/getting-camera-position

we can get camera viewing direction, camera right direction and camera up direction. Do we also need these vectors ?

Thanks

How to get camera view vector / lookat vector

September 6, 2013 - 2:32am #3

Thanks , i will try .

How to get camera view vector / lookat vector

September 6, 2013 - 1:43am #2

Hi, if you need to compute the camera vlookat vector in the model reference frame, you will need to:

- take the lookat vector defined in the camera reference frame, i.e. the vector whose XYZ components are (0, 0, 1)

- multiply this vector by the inverse of the modelview matrix that corresponds to the target pose.

 

Log in or register to post comments