Log in or register to post comments

Detect only if in a certain angle

October 4, 2016 - 6:27pm #1

Hi,

 

How to not detect a printed image target if the angle of the image is greater than 45 degree?

is it possible?

 

Thank you.

Detect only if in a certain angle

October 5, 2016 - 10:50pm #4

My first thought was "whhhaaaat...." 

Then...."oh..he's making a book..."

I'll assume you're making a book. Whatever you did...instead of that...use 2 image targets. A target per page. At any given time, 2 targets are possible. Use the same reply I gave before...measure the angle of those 2 objects to each other. When its 45 degrees or beyond...send a message to the little scene you've popped up...to hide itself. So...you're not really stopping the tracking...you're just not showing the stuff. You can't stop the tracking...but you can decide what to show and when.

If I have it wrong again...then include a lot more information about what you're doing..if its really weird then include some pics or something.

Detect only if in a certain angle

October 4, 2016 - 7:25pm #3

I mean the printed image is greater than 45 degrees



for example I have a full image and then cut it into half.  I make them as image target(separated so i have 2 image targets) . I would like to achieve if the other half is in 45 degree it wont be trackable.

Detect only if in a certain angle

October 4, 2016 - 6:56pm #2

https://docs.unity3d.com/ScriptReference/Vector3.Angle.html

https://docs.unity3d.com/ScriptReference/Vector3.Dot.html

Use whichever flavor of those you prefer. Stick the code on a parent object of your augmentation...in the update of some class...and basically just check the angle of the object vs the camera's...and use GameObject.SetActive( true/false )...

Something like that.

Log in or register to post comments