Topic locked

scale to fit the videoplayer with respect to the imagetarget

December 5, 2014 - 12:01pm #1

Hi,

Videoplayback Sample :

ive been trying to scale to fit the Videoplayer to  the image target marker.I know it can be done manually by scaling the plane mesh and commenting out the line transform.localscale ******.But how to do the same programaticcaly ? am not looking for aspect ration fits.Just scale to fit .can anyone help me on this ?

scale to fit the videoplayer with respect to the imagetarget

February 20, 2015 - 3:34am #8

alryt..solved it myself.tx

scale to fit the videoplayer with respect to the imagetarget

February 19, 2015 - 5:22am #7

.

scale to fit the videoplayer with respect to the imagetarget

February 19, 2015 - 5:21am #6

No alessandro....it didnt work....the videoplayer looks sqaure.But my image target is rectangle

 

for eg : parent imagetarget gameobject scale is 842,842,842.But its carrying a rectangular imagetarget.The imagetarget widht,height is (545,842).The child video player plane fits  only  for (0.06499779, 0.1, 0.09971859)...this one am doing manually.But i want it to programatically.plz help

scale to fit the videoplayer with respect to the imagetarget

January 6, 2015 - 12:58am #5

The Video plane mesh used in the VP sample consists of a Plane gameobject; in Unity, Planes are created by default as a square-shape mesh with side length of 10.

This means that, if you parent the video Plane under an Image Target, it will fit the parent target if you apply a local scale of 0.1 in X and Z (while Y does not matter, as it is the axis orthogonal to the plane itself). That's because size is 10, so 10 x 0.1 = 1

If you want to adjust the scale programmatically, you can just hook some code like transform.localScale = new Vector3( 0.1, 0.1, 0.1 ) in a script attached to the video lane gameobject.

 

 

 

scale to fit the videoplayer with respect to the imagetarget

December 30, 2014 - 10:26am #4

Unity 4.6.1

Vuforia 3.0.10

scale to fit the videoplayer with respect to the imagetarget

December 30, 2014 - 10:23am #3

Which Video Playback sample are you working from - iOS, Android or Unity?

scale to fit the videoplayer with respect to the imagetarget

December 29, 2014 - 9:45am #2

Alessandro....any help on this ?

 

All i want is instead of scaling the video plane manually ....to fit to the imagetarget.I just wanna do it through code.I would really appreaciate if someone could share some idea .....

 

Thanks

Topic locked