Get Started         Best Practices         Developer Guide         FAQ        
Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Rotating Transaalting and Scaling 3d object

Sabarinathan Kulasekaran Feb 23, 2017

Hi i am using the following code to rotate,scale and translate the 3d object but it is not working
float trans[]=new float[3];
float scal[]=new float[3];
float rota[]=new float[3];
CraftARContent3dmodel ccm= new CraftARContent3dmodel(Environment.getExternalStorageDirectory()+"/DCIM/arrow.dae");
trans[0]=(float)-121.6;
trans[1]=(float)8.93;
trans[2]=(float)-2.91;
rota[0]=(float)-86.37;
rota[1]=(float)0;
rota[2]=(float)0;
scal[0]=(float)1;
scal[1]=(float)1;
scal[2]=(float)0.42;

ccm.setTranslation(new float[]{(float)-121.6,(float)8.93,(float)-2.91});
ccm.setRotationMatrix(rota);
ccm.setScale(new float[]{(float)1,(float)1,(float)0.42});


( Agent )
Elena Ouro

Feb 27, 2017

Hello Sabarinathan,

Please refer to the tutorial "Rotating and Translating a 3D model with CraftAR Augmented Reality SDK
" to get an example on how to rotate a 3D model. As you can see, the method setRotationMatrix takes as argument a 4×4 Euler matrix that can be obtained through the method Matrix.SetRotateEuler.
This aside make sure that you are adding the 3D model content you are transforming programatically as it is shown in the example “AR programmatically”: https://github.com/Catchoom/craftar-example-android/blob/master/craftarexampleandroid/src/main/java/com/catchoom/craftarsdkexamples/ARProgrammaticallyActivity.java#L166

If you are still experiencing problems after this please give us some more details regarding if the problem is only transforming the model content but it does appear in the scene and if you see any error messages in the log.

Best,
Elena

0 rated

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Couldn't find what you were looking for?

support@catchoom.com
https://cdn.desk.com/
false
catchoom
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete