Log in or register to post comments

No viable conversion from 'QCAR::Vec3F' to 'QCAR::Vec2F

July 7, 2015 - 1:58am #1

Hello,

I try to immigrate my vuforia 2 application to vuforia 4.0. In older renderFramQCAR method there is a code to take image size

  for (int i = 0; i < state.getNumTrackableResults(); ++i) {

        // Get the trackable

        const QCAR::TrackableResult* result = state.getTrackableResult(i);

        const QCAR::Trackable& trackable = result->getTrackable();

        QCAR::Matrix44F modelViewMatrix = QCAR::Tool::convertPose2GLMatrix(result->getPose());

        const QCAR::ImageTarget& imageTarget =(const QCAR::ImageTarget&) result->getTrackable();

        QCAR::Vec2F targetSize2 = imageTarget.getSize();

}

 

But there is an error in " QCAR::Vec2F targetSize2 = imageTarget.getSize();" like that "No viable conversion from 'QCAR::Vec3F' to 'QCAR::Vec2F' "

Could you help me?

No viable conversion from 'QCAR::Vec3F' to 'QCAR::Vec2F

July 7, 2015 - 5:10pm #2

The objectTarget.getSize() method now returns Vec3F which has width, height, depth. If you are using an ImageTarget, then you can just copy the 2 desired dimensions to Vec2F.

https://developer.vuforia.com/resources/api/ios/class_q_c_a_r_1_1_object_target

 

Log in or register to post comments