Log in or register to post comments

Scaling ImageTarget at runtime to change scene object size?

February 6, 2014 - 10:58am #1

Is it possible to change the scene scale size by changing the imagetarget scale at runtime? This seems to have no effect, whether parented or not... 

Scaling ImageTarget at runtime to change scene object size?

April 4, 2018 - 5:59pm #7

tutorial  to create Augmented Reality on unity with vuforia sdk to create multi image  target and change size (Scaling ) to game objects (Image or 3D model or Text ) on run time show this video

 

https://youtu.be/Y1LqtleBezc

Scaling ImageTarget at runtime to change scene object size?

May 11, 2014 - 7:49am #6

hi alexandro i folowed you instruction to resize my model by " by adjusting the scale factor applied to the

model-view matrix" like you said but every time i was playing aroung the  kObjectScaleNormal = 60.0f;  like here puting it to 60.0, it was doing the job i wanted that is make the model bigger, but the problem is that it was the model was too far from the target, and i actually wanted the model to sit on the target, after going trhought the code i figured out that the code which rezide the model here :

 SampleApplicationUtils::scalePoseMatrix(kObjectScaleNormal, kObjectScaleNormal, kObjectScaleNormal, &modelViewMatrix.data[0]);  

and the  z value here  SampleApplicationUtils::translatePoseMatrix(-70.0f, -220.0f, kObjectScaleNormal, &modelViewMatrix.data[0]);  are using the same constant so when i modified the valiue of the constant (kObjectScaleNormal) it modifies both the z value and the the size of the model 

so what i did is just to put fixed values on the code like this  SampleApplicationUtils::scalePoseMatrix(180.0f, 180.0f180.0f, &modelViewMatrix.data[0]);  

and modified the the kObjectScaleNormal=5.0f   and it does exactly what i wanted i have a bigger model which sits on the targets.

(someone else could just delare a cosntant instead of putting 180.0f three times it would be easy to maintain).

this code is located on the EAGLview.m of the sample app(image target). i hope this helps... 

 

 

 

Scaling ImageTarget at runtime to change scene object size?

May 9, 2014 - 3:05am #5

okay i will check it out and let you know 

Scaling ImageTarget at runtime to change scene object size?

May 9, 2014 - 1:59am #4

If you work with Unity (with iOS target), as I said in my previous post, the model can be attached a s child of the target and be scaled w.r.t. the parent,  like any game object in Unity.

If you work with iOS native SDK (no Unity), then the scale of the model is determined via OpenGL code, i.e. by adjusting the scale factor applied to the model-view matrix (see sample code).

 

Scaling ImageTarget at runtime to change scene object size?

May 9, 2014 - 1:54am #3

hi alexandro is there a way to change the size of the model on the last vuforia sdk? am working in ios

Scaling ImageTarget at runtime to change scene object size?

February 6, 2014 - 11:32am #2

The best would probably be to attach your scene content under the Image Target, and then rescale the root node of your content hierarchy.

 

Log in or register to post comments