ar-duo / ir-ar Goto Github PK
View Code? Open in Web Editor NEWAR을 이용한 이화여고 탐방앱
License: MIT License
AR을 이용한 이화여고 탐방앱
License: MIT License
아직 원장선생님이랑 얘기를 다 못 맞춰서 이번주 평일중으로 결정하려고 한단다
결과 나오는데로 여기다 기재해줄테니 그렇게 알고 있으렴
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;
}
ImgaeTarget -> Canvas
까지 하고 나서 canvas 안에 UI 모델을 input 시
해당 모델을 초기화 해줄필요가 있었음
즉 ImgaeTarget -> Canvas -> UI 모델(Rect Transform 옵션을 reset)
reset뒤에 채연이가 원하는 만큼 UI 모델 크기와 위치를 늘리고 줄여서 화면에 원하는 사이즈로 출력이 됨을 알린다
대신에 애들 있는 강의실에서 진행될꺼니까 그렇게 알고
채연이 너가 맘에 드는 UI 모델이 있으면 그걸 이용해서 메인화면까진 하고 오렴
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 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;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.