Portal belajar membuat aplikasi Augmented Reality dan Virtual Reality

Kamis, 26 September 2019

UNY

00.48 Posted by Dicky Rachmat Iskandar No comments
http://pm.pps.uny.ac.id/id/berita/augmented-reality-kuliah-umum-dari-praktisi-beserta-praktiknya.html

Rabu, 25 September 2019

Spinning Object

02.29 Posted by Dicky Rachmat Iskandar No comments
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SpinWheelScript : MonoBehaviour
{
    float rotationSpeed = 10.0f;
    float lerpSpeed = 1.0f;

    private Vector3 speed;
    private Vector3 avgSpeed;
    private bool dragging = false;
    private Vector3 targetSpeedX;


    void OnMouseDown()
    {
        dragging = true;
    }

    void Update()
    {

        if (Input.GetMouseButton(0) && dragging)
        {
            speed = new Vector3(-Input.GetAxis("Mouse X"), 0, 0);
            avgSpeed = Vector3.Lerp(avgSpeed, speed, Time.deltaTime * 5);
        }
        else
        {
            if (dragging)
            {
                speed = avgSpeed;
                dragging = false;
            }
            var i = Time.deltaTime * lerpSpeed;
            speed = Vector3.Lerp(speed, Vector3.zero, i);
        }

        transform.Rotate(Camera.main.transform.up * speed.x * rotationSpeed, Space.World);
        transform.Rotate(Camera.main.transform.right * speed.y * rotationSpeed, Space.World);
        }
    }
}

Senin, 23 September 2019

UnlitShadow (Shader for a shader in AR mode - Vuforia, EasyAR)

10.02 Posted by Dicky Rachmat Iskandar No comments
Shader "UnlitShadows/UnlitShadowReceive" { Properties{ _Color("Main Color", Color) = (1,1,1,1) _MainTex("Base (RGB)", 2D) = "white" {} _Cutoff("Cutout", Range(0,1)) = 0.5 } SubShader{ Pass{ Alphatest Greater[_Cutoff] SetTexture[_MainTex] } Pass{ Blend DstColor Zero Tags{ "LightMode" = "ForwardBase" } CGPROGRAM #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" #pragma multi_compile_fwdbase #include "AutoLight.cginc" struct v2f { float4 pos : SV_POSITION; LIGHTING_COORDS(0,1) }; v2f vert(appdata_base v) { v2f o; o.pos = mul(UNITY_MATRIX_MVP, v.vertex); TRANSFER_VERTEX_TO_FRAGMENT(o); return o; } fixed4 frag(v2f i) : COLOR{ float attenuation = LIGHT_ATTENUATION(i); return attenuation; } ENDCG } } Fallback "Transparent/Cutout/VertexLit" }