Log in or register to post comments

Hi,

I am using frame-marker sample app. I have multiple 3d objects.

My question is here "How can i rotate a 3d-model and how can i drag the 3D model from one to an other position".

for translation i am using this code but this is doing translation automatically i need to translate object using touch event.

/*

void

computeTargetTranslationFromScreenVector(float screenDeltaX, float screenDeltaY,

QCAR::Matrix44F & modelViewMatrix, QCAR::Vec3F & result)

{

QCAR::Vec3F screenAlignedDisplacement;

screenAlignedDisplacement.data[0] = screenDeltaX;

screenAlignedDisplacement.data[1] = screenDeltaY;

screenAlignedDisplacement.data[2] = 0.0f;

// Compute matrix to pass from Eye Coordinates to Object Coordinates

QCAR::Matrix44F inverseModelViewMatrix =

SampleMath::Matrix44FInverse(modelViewMatrix);

// Convert the screen-aligned displacement vector to Object Coordinates

// (i.e. in the target local reference frame)

QCAR::Vec3F localTargetDisplacement = SampleMath::Vec3FTransformNormal(

screenAlignedDisplacement, inverseModelViewMatrix);

// Compute a speed factor based on the distance of the target from the camera

float distanceObjectToCamera = fabs(modelViewMatrix.data[14]);

float speed = 0.001f * distanceObjectToCamera;// TODO adjust value to your needs

// set the result taking the speed factor into account

result.data[0] = speed * localTargetDisplacement.data[0];

result.data[1] = speed * localTargetDisplacement.data[1];

result.data[2] = speed * localTargetDisplacement.data[2];

}*/

kindly give me suggestions.
Thanks

It's free, just like Unity Basic on iOS and Android :)

N

Is unity SDK is free to use or i have to purchase it's licence ?

This is much easier to do in Unity, which is why we provide the Unity SDK so you might like to try it.

Doing this in native is much more involved and needs more expertise in maths and OpenGL ES.

N

Dear @DavidBeard i have consulted dominoes app but i am able to do just zooming wd it not rotation. and another thing is that i dont want it with touch i want it with pinch gesture recognizor any help will be very greatfull.....

The Dominoes sample demonstrates how to handle and locate touches and strokes - https://developer.vuforia.com/resources/sample-apps/dominos-sample-app

Log in or register to post comments