Log in or register to post comments

ImageTargets sample rotate teapot vuforia 2-6-6

September 4, 2013 - 11:50am #1

Hello,

I'm having a problem succesfully rotating the teapot or moving it for that matter. I have the following code below in the EAGLView.mm file (inside -renderFrameQCAR):

            // OpenGL 2
            QCAR::Matrix44F modelViewProjection;
            
            ShaderUtils::translatePoseMatrix(0.0f, 0.0f, kObjectScale, &modelViewMatrix.data[0]);
            ShaderUtils::scalePoseMatrix(kObjectScale, kObjectScale, kObjectScale, &modelViewMatrix.data[0]);
            ShaderUtils::multiplyMatrix(&qUtils.projectionMatrix.data[0], &modelViewMatrix.data[0], &modelViewProjection.data[0]);
            NSLog(@"Running rotation");
            ShaderUtils::rotatePoseMatrix(180, 0, 0, 1, &modelViewMatrix.data[0]);

 

I put the Log to check to see if it is indeed continuously updating and running the code and I get the print continuously per frame of the live camera feed. So i do know that its running the code but the teapot doesn't budge at all. Is there an anchor that I'm missing that  need to comment out or are there additional lines of cde I need to include?

ImageTargets sample rotate teapot vuforia 2-6-6

June 24, 2016 - 12:23am #5

I want to grab and rotate the teapot with java how can i do that?

ImageTargets sample rotate teapot vuforia 2-6-6

September 6, 2013 - 2:42am #4

... should move the object but it wont budge at all when called.

You need to figure out why you think it should move, and why it won't budge.

 

Try searching the web a little more regarding basic OpenGL ES 2 rotations.

 

Also this thread, while not entirely applicable, may offer some clue:

https://developer.vuforia.com/forum/ios/rotation-speed#comment-2032187

 

N

ImageTargets sample rotate teapot vuforia 2-6-6

September 5, 2013 - 10:33am #3

I have searched the forums, which is how I got the code for the "

ShaderUtils::rotatePoseMatrix(180, 0, 0, 1, &modelViewMatrix.data[0]);

"

however even copy pasting some of the code from 2010-2011 posts in the forums the teapot never changed its orientation or moved at all. For my current project we are working directly in the vuforia SDK, if rotating the teapot is something that is impossible to do in the SDK I'll opt to buy the service for Unity Pro, however I wanted to use straight OpenGL ES to move the 3D object. According to the books and tutorials I have read, it says that line alone in the renderFrameQCAR should move the object but it wont budge at all when called.

ImageTargets sample rotate teapot vuforia 2-6-6

September 5, 2013 - 2:15am #2

Please try and search the forums for "Rotate Teapot".

If you are having problems with basic OpenGL ES then I recommend using Unity because you will find development much easier and faster.

N

Log in or register to post comments