Giter Site home page Giter Site logo

ar-duo / ir-ar Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 39.13 MB

AR을 이용한 이화여고 탐방앱

License: MIT License

Objective-C 0.50% C# 98.44% HLSL 0.12% ShaderLab 0.92% Smalltalk 0.03%
unity unity3d augmented-reality android-application android android-app augmentedreality augmented-reality-application highschool-project

ir-ar's People

Contributors

kimchaeyeon-jessica avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ir-ar's Issues

공지

아직 원장선생님이랑 얘기를 다 못 맞춰서 이번주 평일중으로 결정하려고 한단다

결과 나오는데로 여기다 기재해줄테니 그렇게 알고 있으렴

Text UI title

Text txt;
// Start is called before the first frame update
void Start()
{
    txt = this.GetComponent<Text>();
}

// Update is called once per frame
void Update()
{
    txt.text=DefaultTrackableEventHandler.mTrackableBehaviour.TrackableName;
}

지난번 UI 출력이 제대로 안된점 해결


ImgaeTarget -> Canvas

까지 하고 나서 canvas 안에 UI 모델을 input 시

해당 모델을 초기화 해줄필요가 있었음

ImgaeTarget -> Canvas -> UI 모델(Rect Transform 옵션을 reset)

reset뒤에 채연이가 원하는 만큼 UI 모델 크기와 위치를 늘리고 줄여서 화면에 원하는 사이즈로 출력이 됨을 알린다

내일 토욜날 마감하자

대신에 애들 있는 강의실에서 진행될꺼니까 그렇게 알고

채연이 너가 맘에 드는 UI 모델이 있으면 그걸 이용해서 메인화면까진 하고 오렴

Cloud Handler


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vuforia;

public class SimpleCloudHandler : MonoBehaviour, IObjectRecoEventHandler {
    public ImageTargetBehaviour ImageTargetTemplate;
    private CloudRecoBehaviour mCloudRecoBehaviour; 
    private bool mIsScanning = false; 
    public static string mTargetMetadata = ""; 
// Use this for initialization 
    void Start () { 
// register this event handler at the cloud reco behaviour 
        mCloudRecoBehaviour = GetComponent(); 
  
        if (mCloudRecoBehaviour) 
        { 
            mCloudRecoBehaviour.RegisterEventHandler(this); 
        } 
    }
    public void OnInitialized(TargetFinder targetFinder) {
        Debug.Log ("Cloud Reco initialized");
    }
    public void OnInitError(TargetFinder.InitState initError) {
        Debug.Log ("Cloud Reco init error " + initError.ToString());
    }
    public void OnUpdateError(TargetFinder.UpdateState updateError) {
        Debug.Log ("Cloud Reco update error " + updateError.ToString());
    }
    public void OnStateChanged(bool scanning) {
        mIsScanning = scanning;
        if (scanning)
        {
            // clear all known trackables
            var tracker = TrackerManager.Instance.GetTracker();
            tracker.GetTargetFinder().ClearTrackables(false);
        }
    }
    // Here we handle a cloud target recognition event
    public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) {
        TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = 
            (TargetFinder.CloudRecoSearchResult)targetSearchResult;
        // do something with the target metadata
        mTargetMetadata = cloudRecoSearchResult.MetaData;
        // stop the target finder (i.e. stop scanning the cloud)
        mCloudRecoBehaviour.CloudRecoEnabled = false;
        // Build augmentation based on target 
        if (ImageTargetTemplate) { 
            // enable the new result with the same ImageTargetBehaviour: 
            ObjectTracker tracker = TrackerManager.Instance.GetTracker(); 
            tracker.GetTargetFinder().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject);
            Debug.Log(mTargetMetadata);
        }
    }
    void OnGUI() {
        GUIStyle style = new GUIStyle(GUI.skin.button);
        style.fontSize = 30;
        // Display current 'scanning' status
        // GUI.Box (new Rect(100,100,200,50), mIsScanning ? "Scanning" : "Not scanning");
        // // Display metadata of latest detected cloud-target
        // GUI.Box (new Rect(100,200,200,50), "Metadata: " + mTargetMetadata);
        // If not scanning, show button
        // so that user can restart cloud scanning
        if (!mIsScanning) {
            if (GUI.Button(new Rect(100,300,300,150), "Restart Scanning",style)) {
            // Restart TargetFinder
            mCloudRecoBehaviour.CloudRecoEnabled = true;
            }
        }
    }
}

Text UI body

Text txt;
// Start is called before the first frame update
void Start()
{
    txt = this.GetComponent<Text>();
}

// Update is called once per frame
void Update()
{
   txt.text=SimpleCloudHandler.mTargetMetadata;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.