Docsity
Docsity

Prepara i tuoi esami
Prepara i tuoi esami

Studia grazie alle numerose risorse presenti su Docsity


Ottieni i punti per scaricare
Ottieni i punti per scaricare

Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium


Guide e consigli
Guide e consigli

Guida Instant Tracking MAXST, Esercizi di Elementi di Informatica

In questa guida scoprirai come realizzare una piccola applicazione per fare il tracking con la realtà aumentata

Tipologia: Esercizi

2017/2018

Caricato il 15/06/2018

scema84
scema84 🇮🇹

1

(1)

2 documenti

1 / 8

Toggle sidebar

Documenti correlati


Anteprima parziale del testo

Scarica Guida Instant Tracking MAXST e più Esercizi in PDF di Elementi di Informatica solo su Docsity! MAXST INSTANT TRACKING The Instant Tracker instantly scans the planar surface in the camera frame and recognizes the space with sensors. You can find the rendered 3D object on the space. Make Instant Tracker Scene 1. [Install MAXST AR SDK for Unity.][Install MAXST AR SDK for Unity] 2. Create a new scene. 3. Delete the Main Camera that exists by default and add 'Assets > MaxstAR > Prefabs > ARCamera, InstantTrackable' to the scene. ※ If you build, you should add License Key to ARCamera. 4.Create an empty object and add 'Assets > MaxstARSamples > Scripts > InstantTrackerSample' as a component. 5.Create a Button, place it in the proper location, and register the OnClickStart () function of the InstantTrackerSample script in the Click Event. 7.After creating a cube as a child of InstantTrakable, adjust the scale between 0.1 and 0.3. 8.After Playing, click the button to learn the space instantly and augment the cube. Start / Stop Tracker To start / stop Tracker, refer to the following code. >InstantTrackerSample.cs void Update() { ... TrackerManager.GetInstance().StartTracker(TrackerManager.TRACKER_TYPE_INSTA NT); SensorDevice.GetInstance().Start(); ... } void OnApplicationPause(bool pause) { ... SensorDevice.GetInstance().Stop(); TrackerManager.GetInstance().StopTracker(); ... } void OnDestroy() { SensorDevice.GetInstance().Stop(); TrackerManager.GetInstance().StopTracker(); TrackerManager.GetInstance().DestroyTracker(); } Use Tracking Information To use the Tracking information, refer to the following code. >InstantTrackerSample.cs void Update() { ... TrackingState state = TrackerManager.GetInstance().UpdateTrackingState(); TrackingResult trackingResult = state.GetTrackingResult(); instantTrackable.OnTrackFail(); if (trackingResult.GetCount() == 0) { return; } if (Input.touchCount > 0) { UpdateTouchDelta(Input.GetTouch(0).position); } Trackable trackable = trackingResult.GetTrackable(0); Matrix4x4 poseMatrix = trackable.GetPose() * Matrix4x4.Translate(touchSumPo sition); instantTrackable.OnTrackSuccess(trackable.GetId(), trackable.GetName(), pos eMatrix); } GitHub Unity Scene Example GitHub Unity Scene Example: https://github.com/maxstdev/MaxstARSDK_Unity_Sample.git More • ExtraInstantTrackerBrush • ExtraInstantTrackerGrid • ExtraInstantTrackerMultiContents Hardware Requirements for Android MAXST AR SDK's Instant Tracker uses internally Android Rotation Vector related to both gyro and compass sensors. If your target device has no gyro or compass sensor, the engine can not find the initial pose. If there is no sensor value, our engine assumes the front scene as a ground plane. If you want to check whether the current device support Android Rotation Vector, please refer to the following codes. SensorManager mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE) ; List<Sensor> sensors = mSensorManager.getSensorList(TYPE_ROTATION_VECTOR); Log.i(TAG, "# sensor : " + sensors.size()); for(int i=0; i<sensors.size(); i++) { Log.i(TAG, sensors.get(i).getName()); } if(sensors.isEmpty()) {
Docsity logo


Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved