Log in or register to post comments

Rotate Object Vuforia/Jpct

May 17, 2013 - 1:30am #1

Hi,

i would like to rotate my 3D Model in Zaxis by pressing an button.

How and where i have to implement my Code.

I use Vuforia with jpct_ae

 

Thanks

Rotate Object Vuforia/Jpct

May 23, 2013 - 7:36am #7

Hi, 

this is really about the JPCT engine and Java programming, I'm not sure whether posting this issue in this Forum is appropriate.

Rotate Object Vuforia/Jpct

May 23, 2013 - 6:29am #6

Hi,

i tried a lot but nothing was succesfully.

I made a global vari. like:

boolean clicked=true;

I wrote my Button method:

public void dreher() {
        
        Button rotate = (Button) this.findViewById(R.id.button1);

    
        //if click on me, then display the current rating value.
        rotate.setOnClickListener(new OnClickListener() {
    
            
            public void onClick(View v) {
    
                clicked=false;
                       
            }
   ..

And than i put the if stuff in my onDrawFrame:

if(clicked==false){
            cube.rotateZ(0.055f);
        
        }

 

But the Model still dont rotate.

Does anyone have an Idea?

Thanks

 

Rotate Object Vuforia/Jpct

May 18, 2013 - 11:48pm #5

Hi, the renderFrame() method is already called in the ImageTargetsRenderer.java; you should not need to do anything special, 

just pass the rotation angle down to C++ from Java.

 

Rotate Object Vuforia/Jpct

May 18, 2013 - 9:40am #4

maybe with:

this.renderFrame();

 

but  how call the special call to rotatepostMatrix..

Rotate Object Vuforia/Jpct

May 18, 2013 - 7:34am #3

Hi,

now i have impement in the JNI Folder to the renderFrame...

this code:

  float angle = 0.0f; // YOUR ROTATION ANGLE HERE (in degrees)
        SampleUtils::rotatePoseMatrix(angle, 0.0f, 0.0f, 1.0f,
                                     &modelViewMatrix.data[0]);
 

 

I have this made in Java:

public native void renderFrame();

How can i call the method in java ?

 

 

Rotate Object Vuforia/Jpct

May 17, 2013 - 6:53am #2

Hi,

this page describes how you can rotate an object using our samples and openGL:

https://developer.vuforia.com/forum/faq/android-how-can-i-rotate-teapot

However, for specific engines like jpct-ae, you should look in the JPCT-ae website.

For the button implementation part, that's just Android programming.

Once the button is triggered, you can communicate to the native code using the JNI interface, as shown in our samples, or as explained here:

https://developer.vuforia.com/resources/dev-guide/java-native-interface

 

Log in or register to post comments