期末demo
成員:
03160251 劉竑礽
03160276 蔡沛蓉
03160703 藍玉雯
雖然我們做這個作業做的頭很痛
不過屢屢跨過好多次障礙
最後還獲得銅獎肯定
真的非常開心!!
demo影片連結:
https://youtu.be/yjJPZgO1XZA
2017年6月23日 星期五
2017年6月18日 星期日
week11
上課看老師分享的影片
有手拉坯 拉彩帶 做陶土等各種建模
老師上課放的影片
https://www.facebook.com/vrscout/videos/1286384778083207/
有手拉坯 拉彩帶 做陶土等各種建模
老師上課放的影片
https://www.facebook.com/vrscout/videos/1286384778083207/
2017年6月15日 星期四
2017年5月3日 星期三
week11
今天教如何做出建模效果
捏彩帶
做陶土
最後可以左出會旋轉的陶土
參考影片
https://www.facebook.com/vrscout/videos/1286384778083207/
捏彩帶
做陶土
最後可以左出會旋轉的陶土
參考影片
https://www.facebook.com/vrscout/videos/1286384778083207/
2017年3月30日 星期四
week06
到s205實作
用手把偵測產生設定好的prefabs物件
然後就可以做出類似畫畫的效果



.
程式碼如下
using UnityEngine;
using System.Collections;
using Valve.VR;
public class Create : MonoBehaviour {
public SteamVR_TrackedObject rightController;
public GameObject redCube;
public GameObject blueCube;
public GameObject box;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
var device = SteamVR_Controller.Input ((int)rightController.index);
if (device.GetPressDown (SteamVR_Controller.ButtonMask.Trigger)) {
Instantiate (redCube, rightController.transform.position, rightController.transform.rotation, box.transform);
}
if (device.GetPress (SteamVR_Controller.ButtonMask.Trigger)) {
Instantiate (blueCube, rightController.transform.position, rightController.transform.rotation, box.transform);
}
if (device.GetPressUp (SteamVR_Controller.ButtonMask.Trigger)) {
foreach (Transform child in box.transform) {
GameObject.Destroy (child.gameObject);
}
}
}
}
第二個實作
是要把場景中的物件抓取起來
按下版機就可以當手一樣 把物件抓取起來

程式碼如下:
using UnityEngine;
using System.Collections;
public class Touch : MonoBehaviour {
public SteamVR_TrackedObject leftController;
bool isTouch=false;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
var device = SteamVR_Controller.Input ((int)leftController.index);
if (device.GetPressDown (SteamVR_Controller.ButtonMask.Trigger)) {
isTouch = true;
}
if (device.GetPressUp (SteamVR_Controller.ButtonMask.Trigger)) {
isTouch = false;
}
}
void OnTriggerStay(Collider other){
if (other.tag == "catch" && isTouch) {
other.transform.position = this.transform.position;
}
}
}
第三個實作(回家作業)
將模型套入
讓手把在實境內是以光劍模組顯示


成功後就可以像絕地武士一樣揮舞光劍了!!!!
程式碼如下:
using UnityEngine;
using System.Collections;
public class LightSaberContol : MonoBehaviour {
public SteamVR_TrackedObject Controller;
public GameObject centerBeam;
lightsaber saberOn,saberCenterBeam;
void Start () {
saberOn = this.GetComponent<lightsaber> ();
saberCenterBeam = centerBeam.GetComponent<lightsaber> ();
}
// Update is called once per frame
void Update () {
if (Controller == null)
return;
var device = SteamVR_Controller.Input ((int)Controller.index);
if (device.GetPressDown (SteamVR_Controller.ButtonMask.Grip)) {
saberOn.saberon = !saberOn.saberon;
saberCenterBeam.saberon = !saberCenterBeam.saberon;
print ("Grip");
}
}
}
用手把偵測產生設定好的prefabs物件
然後就可以做出類似畫畫的效果



.
程式碼如下
using UnityEngine;
using System.Collections;
using Valve.VR;
public class Create : MonoBehaviour {
public SteamVR_TrackedObject rightController;
public GameObject redCube;
public GameObject blueCube;
public GameObject box;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
var device = SteamVR_Controller.Input ((int)rightController.index);
if (device.GetPressDown (SteamVR_Controller.ButtonMask.Trigger)) {
Instantiate (redCube, rightController.transform.position, rightController.transform.rotation, box.transform);
}
if (device.GetPress (SteamVR_Controller.ButtonMask.Trigger)) {
Instantiate (blueCube, rightController.transform.position, rightController.transform.rotation, box.transform);
}
if (device.GetPressUp (SteamVR_Controller.ButtonMask.Trigger)) {
foreach (Transform child in box.transform) {
GameObject.Destroy (child.gameObject);
}
}
}
}
第二個實作
是要把場景中的物件抓取起來
按下版機就可以當手一樣 把物件抓取起來

程式碼如下:
using UnityEngine;
using System.Collections;
public class Touch : MonoBehaviour {
public SteamVR_TrackedObject leftController;
bool isTouch=false;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
var device = SteamVR_Controller.Input ((int)leftController.index);
if (device.GetPressDown (SteamVR_Controller.ButtonMask.Trigger)) {
isTouch = true;
}
if (device.GetPressUp (SteamVR_Controller.ButtonMask.Trigger)) {
isTouch = false;
}
}
void OnTriggerStay(Collider other){
if (other.tag == "catch" && isTouch) {
other.transform.position = this.transform.position;
}
}
}
第三個實作(回家作業)
將模型套入
讓手把在實境內是以光劍模組顯示


成功後就可以像絕地武士一樣揮舞光劍了!!!!
程式碼如下:
using UnityEngine;
using System.Collections;
public class LightSaberContol : MonoBehaviour {
public SteamVR_TrackedObject Controller;
public GameObject centerBeam;
lightsaber saberOn,saberCenterBeam;
void Start () {
saberOn = this.GetComponent<lightsaber> ();
saberCenterBeam = centerBeam.GetComponent<lightsaber> ();
}
// Update is called once per frame
void Update () {
if (Controller == null)
return;
var device = SteamVR_Controller.Input ((int)Controller.index);
if (device.GetPressDown (SteamVR_Controller.ButtonMask.Grip)) {
saberOn.saberon = !saberOn.saberon;
saberCenterBeam.saberon = !saberCenterBeam.saberon;
print ("Grip");
}
}
}
2017年3月15日 星期三
2017年3月8日 星期三
2017年3月2日 星期四
Week2
2017年2月22日 星期三
訂閱:
文章 (Atom)

























