Skip to content

Instantly share code, notes, and snippets.

public void Update ()
{
_QuitOnConnectionErrors();
// The tracking state must be FrameTrackingState.Tracking in order to access the Frame.
if (Frame.TrackingState != FrameTrackingState.Tracking)
{
const int LOST_TRACKING_SLEEP_TIMEOUT = 15;
Screen.sleepTimeout = LOST_TRACKING_SLEEP_TIMEOUT;
return;
//もともとあったコード。m_meshに頂点情報(座標と順番)や色情報を渡している
m_mesh.Clear();
m_mesh.SetVertices(m_meshVertices);
m_mesh.SetIndices(m_meshIndices.ToArray(), MeshTopology.Triangles, 0);
m_mesh.SetColors(m_meshColors);
//下記の2行を新たに追加。上記で作成した三角形の集合をコライダーに反映
//Add following 2 lines. This cord attaches triangular mesh information to collider.
GetComponent<MeshCollider>().sharedMesh = null;
GetComponent<MeshCollider>().sharedMesh = m_mesh;
<!DOCTYPE html>
<html>
<head>
<title>Hello, WebVR! - A-Frame</title>
<meta name="description" content="Hello, WebVR! - A-Frame">
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-cylinder position="0 0 -1" radius="0.2" height="0.5" color="#FFC65D" shadow></a-cylinder>
<!DOCTYPE html>
<html>
<head>
<title>Hello, WebVR! - A-Frame</title>
<meta name="description" content="Hello, WebVR! - A-Frame">
<script src="https://aframe.io/releases/0.7.0/aframe.min.js"></script>
<!--three.ar.jsとaframe-ar.jsを追加(下記2行)-->
<script src="https://rawgit.com/google-ar/three.ar.js/master/dist/three.ar.js"></script>
<script src="https://rawgit.com/chenzlabs/aframe-ar/master/dist/aframe-ar.js"></script>
</head>
<a-scene background="color: #FAFAFA">
<a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow></a-box>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E" shadow></a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4" shadow></a-plane>
<!--下記を追加-->
<a-entity id="ctlL" laser-controls="hand: left"></a-entity>
<a-entity id="ctlR" laser-controls="hand: right"></a-entity>
<a-entity camera look-controls position="0 1.6 0">
<a-text id="txt" value="test" position="0 0 -1" scale="0.5 0.5 0.5" align="center" color="#000000"></a-text>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello, WebVR! • A-Frame</title>
<meta name="description" content="Hello, WebVR! • A-Frame">
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
</head>
<body>
<a-scene background="color: #FAFAFA">
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Created December 2, 2019 02:20
Connecting Test of Azure Kinect for C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//①AzureKinectSDKの読み込み
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Last active March 1, 2023 09:33
Initialize Bitmap for Color Image of Azure Kinect
//Kinectを扱う変数
Device kinect;
//(追加①)カラー画像のBitmap
Bitmap colorBitmap;
public Form1()
{
InitializeComponent();
InitKinect();
//(追加②)Kinectの設定情報に基づいてBitmap関連情報を初期化
InitBitmap();
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Last active March 1, 2023 09:33
Color Image Viewer of Azure Kinect
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//AzureKinectSDKの読み込み
@TakashiYoshinaga
TakashiYoshinaga / Form1.cs
Created December 3, 2019 09:18
Initialize Bitmap for Depth Image of Azure Kinect
//Kinectを扱う変数
Device kinect;
//(追加①)Depth画像のBitmap
Bitmap depthBitmap;
public Form1()
{
InitializeComponent();
InitKinect();
//(追加②)Kinectの設定情報に基づいてBitmap関連情報を初期化
InitBitmap();