hi,
First need to set the world center at Augmenter for Augmenter
And then rewrite the Update method in ImageTarge's EasyImageTargetBehaviour class
protected override void Update()
{
base.Update();
float myrx = 0;
myrx = this.transform.localEulerAngles.x;
while (myrx >= 360)
{
myrx -= 360;
}
while (myrx <= -360)
{
myrx += 360;
}
while (myrx > 270 && 360 - myrx >= 0)
myrx = -(360 - myrx);
float myry = 0;
myry = this.transform.localEulerAngles.y;
while (myry >= 360)
{
myry -= 360;
}
while (myry <= -360)
{
myry += 360;
}
while (myry > 270 && 360 - myry >= 0)
myry = -(360 - myry);
float myrz = 0;
myrz = this.transform.localEulerAngles.z;
while (myrz >= 360)
{
myrz -= 360;
}
while (myrz <= -360)
{
myrz += 360;
}
while (myrz > 270 && 360 - myrz >= 0)
myrz = -(360 - myrz);
if (((Math.Abs(this.transform.position.x - lastX) > 0.06 || Math.Abs(this.transform.position.y - lastY) > 0.06 || Math.Abs(this.transform.position.z - lastZ) > 0.06)&&
(Math.Abs(this.transform.position.x - lastX) > 0.13 || Math.Abs(this.transform.position.y - lastY) > 0.13 || Math.Abs(this.transform.position.z - lastZ) > 0.13))||
( (Math.Abs(myrx - lastRX) > 3 &&Math.Abs(myry - lastRY) >3 &&Math.Abs(myrz - lastRZ) > 3)&& (Math.Abs(myrx - lastRX) > 6 || Math.Abs(myry - lastRY) > 6 || Math.Abs(myrz - lastRZ) > 6))
{
lastX = this.transform.position.x;
lastY = this.transform.position.y;
lastZ = this.transform.position.z;
lastRX = myrx;
lastRY = myry;
lastRZ = myrz;
this.transform.rotation = Quaternion.Euler(lastRX, lastRY, lastRZ);
this.transform.position = new Vector3(lastX, lastY, lastZ);
}
else
{
this.transform.rotation = Quaternion.Euler(lastRX, lastRY, lastRZ);
this.transform.position = new Vector3(lastX, lastY, lastZ);
}
}