Implementasi Augmented Reality (Ar) Pengenalan Alat Musik Terompet Reog Jawa Timur Berbasis Android

A-1
3

LISTING PROGRAM

Script Tombol dan Exit :
using UnityEngine;
using System.Collections;
public class tombol : MonoBehaviour {
public void aksi (int startaksi){
Application.LoadLevel(startaksi);
}
public void ExitApplication()
{
Application.Quit ();
}
}
Script Rotate :
using UnityEngine;
using System.Collections;
public class Rotate : MonoBehaviour {

private float rotationRate = 3.0f;
void Update () {
// get the user touch input
foreach (Touch touch in Input.touches) {
Debug.Log("Touching at: " + touch.position);
if (touch.phase == TouchPhase.Began) {
Debug.Log("Touch phase began at: " + touch.position);
} else if (touch.phase == TouchPhase.Moved) {
Debug.Log("Touch phase Moved");
transform.Rotate
(touch.deltaPosition.y
*
rotationRate,
touch.deltaPosition.x
*
rotationRate,
0,
Space.World);
} else if (touch.phase == TouchPhase.Ended) {
Debug.Log("Touch phase Ended");

}
}
}
}

Universitas Sumatera Utara

4
A-2

Script Virtual Button Suara:
using UnityEngine;
using System.Collections.Generic;
using Vuforia;
public class VirtualButtonEventHandler : MonoBehaviour,
IVirtualButtonEventHandler {
public
public
public
public

public

AudioSource
AudioSource
AudioSource
AudioSource
AudioSource

Sound;
Sound1;
Sound2;
Sound3;
Sound4;

void Start() {
VirtualButtonBehaviour[] vbs=
GetComponentsInChildren();
for (int i = 0; i < vbs.Length; ++i) {
vbs[i].RegisterEventHandler(this);
}

}
public void
OnButtonPressed(VirtualButtonAbstractBehaviour vb) {
Debug.Log(vb.VirtualButtonName);
Debug.Log("Button pressed!");
switch(vb.VirtualButtonName) {
case "satu":
Sound.Play();
break;
case "dua":
Sound1.Play();
break;
case "tiga":
Sound2.Play();
break;
case "empat":
Sound3.Play();
break;
case "lima":
Sound4.Play();

break;
default:
throw new UnityException("Button not
supported: " + vb.VirtualButtonName);

Universitas Sumatera Utara

5
A-3

break;
}
}
public void
OnButtonReleased(VirtualButtonAbstractBehaviour vb)
{
Debug.Log("Button released!");
}
}
Script Zoom :

using UnityEngine;
namespace Lean.Touch
{
public class LeanScale : MonoBehaviour
{
[Tooltip("Ignore fingers with StartedOverGui?")]
public bool IgnoreGuiFingers;
[Tooltip("Allows you to force rotation with a specific
amount of fingers (0 = any)")]
public int RequiredFingerCount;
[Tooltip("Does scaling require an object to be
selected?")]
public LeanSelectable RequiredSelectable;
[Tooltip("Should the scaling be performanced relative
to the finger center?")]
public bool Relative;
#if UNITY_EDITOR
protected virtual void Reset()
{
if (RequiredSelectable == null)

{
RequiredSelectable =
GetComponent();
}
}
#endif
protected virtual void Update()
{
if (RequiredSelectable != null &&
RequiredSelectable.IsSelected == false)
{
return;

Universitas Sumatera Utara

6
A-4

}
var fingers = LeanTouch.GetFingers(IgnoreGuiFingers,

RequiredFingerCount);
var scale
=
LeanGesture.GetPinchScale(fingers);
var screenCenter =
LeanGesture.GetScreenCenter(fingers);
Scale(scale, screenCenter);
}
private void Scale(float scale, Vector2 screenCenter)
{
if (scale > 0.0f)
{
if (Relative == true)
{
var screenPosition =
Camera.main.WorldToScreenPoint(transform.position);
screenPosition.x = screenCenter.x +
(screenPosition.x - screenCenter.x) * scale;
screenPosition.y = screenCenter.y +
(screenPosition.y - screenCenter.y) * scale;

transform.position =
Camera.main.ScreenToWorldPoint(screenPosition);
transform.localScale *= scale;
}
else
{
transform.localScale *= scale;
}
}
}
}
}

Universitas Sumatera Utara

7
A-5

Script Koordinat AR Camera :




//Pemanggilan Vuforia kamera AR










Universitas Sumatera Utara

8

CURRICULUM VITAE
Identitas Pribadi
Nama Lengkap

Nama akrab
Tanggal Lahir
Tempat Lahir
Tinggi/ Berat badan
Jenis Kelamin
Status Perkawinan
Agama
Alamat
Nomor HP
E-mail

: Fajri Jauhari
: Fajri
: 27 Juni 1992
: Aek Nabara
: 160 cm/ 60 kg
: Laki-laki
: Belum Menikah
: Islam
: Dusun II Purwodadi No.478 Kec.Pagar Merbau
: 085371491546
: fajripublisher@gmail.com

Pendidikan Formal
Pendidikan
SD
SMP
SMA
Universitas

Sekolah
SDN No.101971 – Sei Karang
SMPN 1 Lubuk Pakam – Lubuk Pakam
SMAN 1 Lubuk Pakam – Lubuk Pakam
D3 Teknik Informatika USU – Sumatera Utara

Tahun
1999 – 2005
2005 – 2008
2008 – 2011
2011 – 2014

Seminar / Workshop / Kursus
Training / Seminar / Workshop
Mobile Application and Networking
Seminar Nasional Literasi Informasi
(SENARAI)

Tempat
USU, Sumatera Utara
USU, Sumatera Utara

Tahun
2012
2014

Universitas Sumatera Utara