Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
using System.Collections;
using OpenCvSharp.CPlusPlus;
using OpenCvSharp;
using System;
public class FaceDetect : MonoBehaviour {
public int Width = 640;
public int Height = 480;
public int FPS = 30;
  • HoloLensの日本での展開は未定
  • HMDではなく、Windows 10が動くPCである
  • HoloLensの機能
    • 現実世界を彩るホログラム
    • コネクションや創造、探索の新しい方法
    • より自然な対話の手段
    • マイクロソフトの最先端テクノロジー
  • ハードウェア
  • ケーブルレスのコンピューター
  • 周辺デバイスではない
using UnityEngine;
using UnityEngine.VR.WSA.Input;
using UnityEngine.UI;
public class DrawMeshChanger : MonoBehaviour
{
GestureRecognizer recognizer;
public SpatialMapping mapping;
using UnityEngine;
using System.Collections;
public class CubeCreator : MonoBehaviour
{
public GameObject cubePrefab;
// Use this for initialization
void Start()
{
public void SetMaterial(Material mat)
{
DrawMaterial = mat;
foreach (var surface in surfaces)
{
surface.Value.GetComponent<MeshRenderer>().sharedMaterial = mat;
}
}
public bool IsMeshCreated
{
get{
return surfaces.Count != 0;
}
}
Eigen::Vector3f floor(floorClip.x, floorClip.y, floorClip.z);
Eigen::Quaternionf rotate = Eigen::Quaternionf::FromTwoVectors(floor, Eigen::Vector3f::UnitY());
Eigen::Translation<float, 3> translation(0, floorClip.w, 0);
Eigen::DiagonalMatrix<float, 3> scaling = Eigen::Scaling(1.0f, 1.0f, 1.0f);;
floorMatrix = translation * scaling * rotate;
// 点群の表示
{
gl.Begin( OpenGL.GL_POINTS );
foreach ( var point in kinect.PointCloud ) {
if ( (point.X == 0) && (point.Y == 0) && (point.Z == 0) ) {
continue;
}
Vector3 v = new Vector3( point.X, point.Y, point.Z );
// 床からの回転matrixを作成
{
// http://gamedev.stackexchange.com/questions/80310/transform-world-space-using-kinect-floorclipplane-to-move-origin-to-floor-while
var vector = new Vector4(
kinect.FloorClipPlane.X,
kinect.FloorClipPlane.Y,
kinect.FloorClipPlane.Z,
kinect.FloorClipPlane.W );
var yNew = new Vector3( vector.X, vector.Y, vector.Z );
async void OnLoaded( object sender, RoutedEventArgs e )
{
var color = new
{
Name = "Color Sources",
AccessStatus = await PerceptionColorFrameSource.RequestAccessAsync(),
Devices = await PerceptionColorFrameSource.FindAllAsync()
};
this.ctlColor.DataContext = color;