This is Import Setting to Open Spatial Mapping.obj downloaded from WDP(Windows Device Portal) in 3ds Max 2015


WDP에서 받은 SpatialMapping.obj 파일을 3dsMax 2015에서 임포트할 때 다음과 같이 세팅합니다


단, 오브젝트가 뒤집어져서 임포트됩니다






After Editing the Mesh in Editable Poly, You can export edited mesh and Open it in Unity Editor


3ds Max로 임포트한 후, Editable Poly로 수정을 하고나서 이 수정된 오브젝트를 다시 익스포트 후 유니티 에디터에서 열 수 있습니다.


This is Export Setting to export and open it in Unity Editor. But, with These Import/Export Settings

mesh is flipped.


다음과 같이 익스포트 설정을 하여 유니티에서 열 수 있습니다.


이때도 오브젝트가 뒤집어져서 나옵니다




Next 2 pictures are Before/After Captured Image from Unity Editor.

I changed part of mesh of table (Yellow box is difference between them.)


다음 두장의 사진은 메핑 메쉬를 3ds Max로 임포트해 테이블 다리를 수정 후 export를 거쳐

유니티 에디터에서 불러온 두 메쉬 비교 사진입니다.






메쉬가 뒤집어지지 않고 임포트,익스포트가 가능한 세팅을 찾아봐야하겠습니다 


-----------------------------------------------------------------------------------------


곧바로 찾았습니다. Export/Import 시 Flip YZ - axis 를 체크해주면 뒤집어지지않습니다


This is new and mostly perfect settings for Import/Export SpatialMappign.obj into/from 3ds Max 2015 That do not flip the Object.






And These are new Captures



 

'홀로렌즈(HoloLens) > SpatialMapping' 카테고리의 다른 글

Spatial Mapping in Unity 번역  (0) 2017.07.18
Holotoolkit - Spatial Mapping  (0) 2017.07.17

https://developer.microsoft.com/en-us/windows/mixed-reality/spatial_mapping_in_unity#using_the_built-in_spatial_mapping_components



1. 홀로툴킷의 SpatialMapping 컴포넌트는 매우 간편하고 신속한 길을 제공

2. Lower level spatial mapping API는 full control을 제공하고 명확하고 세련된 애플리케이션 커스터마이제이션을 가능하게 한다



유니티 빌트인 컴포넌트 시작하기


Spatial Mapping Renderer 와 Spatial Mapping Collider 를 제공함


Spatial Mapping Renderer - 메쉬의 시각화


Spatial Mapping Collider - 메쉬와 홀로그래픽 컨텐츠의 상호작용 예) 물리력



빌트인 컴포넌트 사용하기


1. spatial surface mesh를 찾고싶은 구역 가운데에 있는 게임오브젝트를 선택

2. Inspector 창에서 Add Component > AR > Spatial Mapping Collider or Spatial Mapping Renderer.



로우레벨 SpatialMapping API 사용하기


네임스페이스 - UnityEngine.VR.WSA


타입 - SurfaceObserver, SurfaceChange, SurfaceData, SrufaceId


SurfaceObserver 세팅하기


SurfaceObserver surfaceObserver;


void Start()
{
    surfaceObserver = new SurfaceObserver();    //생성

//surfaceObserver.SetVolumeAsAxisAlignedBox, SetVolumeAsSphere 등으로 공간의 구역 정의

//SurfaceObserver.Update 사용하려면 새로운 데이터를 가진 매핑 시스템 지역의 각각의 spatial surface에 대해 핸들러를 정의해야함

}

private void OnSurfaceChanged(SurfaceId surfaceId, SurfaceChange changeType, Bounds bounds, System.DataTime updateTime)
{
    //see Handling Surface Changes

}


Handling Surface Changes



홀로툴킷 SpatialMapping 부분 번역

(https://github.com/Microsoft/HoloToolkit-Unity/tree/master/Assets/HoloToolkit/SpatialMapping)


프리팹


RemoteMapping – 홀로렌즈에서 유니티로 메쉬를 보내 저장,로드하여 나중에 사용 가능


SpatialMapping – 홀로렌즈의 데이터에 접근,시각화 함. 또한 WDP에서 캡쳐한 룸 모델을 저장/로드


SurfacePlane – 바닥, 천장, 벽 등을 판별해주는 평면 프리팹

 


스크립트


ObjectSurfaceObserver.cs - WDP에서부터 매핑 데이터를 로드

RoomModel – 유니티에서 메쉬를 로드하는데 사용할 룸 모델

 

SpatialMappingManager.cs – 애플리케이션과 모든 매핑데이터 소스(파일,옵저버,네트워크) 간의 상호작용을 관리

PhysicalLayer – 매핑 데이터를 사용할 physics layer

SurfaceMaterial - 매핑 데이터를 랜더링할때 적용할 메터리얼

DrawVisualMeshes - 매핑 데이터를 랜더링할 지 결정함

CastShadows - 매핑 메쉬가 그림자를 cast 할 지 결정


SpatialMappingObserver.cs - 홀로렌즈 실행 동안 SurfaceObserver를 통해 찾은 모든 surfaces의 매핑 데이터를 추가하고, 갱신함

TrianglesPerCubicMeter - SurfaceObserver가 찾은 각각의 메쉬에 대한 Level of Detail (값이 클 수록 디테일함)

Extents - 카메라 위치에서 어디까지 관찰할 것인지의 정도

TimeBetweenUpdates - SurfaceObserver에서부터 갱신할 주기


SpatialMappingSource.cs - 현재 소스 오브젝트(파일,옵저버,네트워크)의 매핑 데이터 기반의 메쉬를 생성, 불러옴. SpatialMappingManager.cs는 소스 타입과 이 클래스 사이를 스위칭함(?)

TapToPlace.cs - 게임오브젝트를 탭하여 매핑 메쉬 위에 배치할 수 있는 간단한 스크립트. 오브젝트의 부모오브젝트를 옮길 수도 있음

 GazeManager, GestureManager, SpatialMappingManager 가 씬에 있어야함




Scripts/RemoteMapping - 매핑 데이터를 홀로렌즈에서 유니티 에디터로 보내어 메쉬를 저장,로드 하여 추후에 사용 가능


FileSurfaceObserver.cs - remote mapping session 동안 저장된 spatial mapping 데이터를 로드하는 SpatialMappingSource

MeshFileName - 네트워크나 로드한 메쉬 데이터를 유니티로 저장할 때 쓸 파일 이름

SaveFileKey - 유니티 에디터로 실행 중 네트워크로부터의 메쉬를 저장할 때 누를 버튼

LoadFileKey - 유니티 에디터로 실행 중 네트워크로부터의 메쉬를 불러올 때 누를 버튼


MeshSaver.cs - 원격 매핑 세션 동안 FileSurfaceObserver의 파일로 보낸 메쉬데이터를 일고 쓰는 전역 클래스

RemoteMappingKey - 유니티 에디터로 실행 중 네트워크 상에 spatial mapping을 가능하게하는 버튼

SendMeshesKeyword - 홀로렌즈에서 유니티로 메쉬를 보낼 때 말할 음성명령어


RemoteMeshSource.cs - 홀로렌즈에서 실행하고, 메쉬를 유니티로 보낼 수 있는 네트워크 요소

ServerIP - 유니티를 실행하는 기기의 IPv4 주소

ConnectionPort - 홀로렌즈로부터 매핑 데이터를 받을 유니티 기기의 네트워크 포트


RemoteMeshTarget.cs - 유니티 에디터에서 실행되는 SpatialMappingSource 오브젝트. 홀로렌즈로부터 매핑 데이터를 받음

ServerIP - 유니티를 실행하는 기기의 IPv4 주소

ConnectionPort - 홀로렌즈로부터 메쉬 데이터를 받을 유니티 기기의 네트워크 포트


SimpleMeshSerializer.cs - 유니티 메쉬를 byte 배열로 바꾸는 전역 클래스. 원격 매핑 세션 동안 전송된 메쉬 데이터를 serialize, deserialize 할 때 MeshSaver.cs에 의해 사용됨



Scripts/SpatialProcessing - raw spatial mapping data를 처리하여 평면 찾기, 꼭지점 지우기 등 가능


PlaneFinding.cs - 기존 PlaneFinding DLL 을 덮는 유니티 스크립트. SurfaceMeshesToPlane.cs가 사용함


RemoveSurfaceVertices.cs - 명시된 bounding volume 외의(?) 정점들을 지우는 Spatial processing 컴포넌트

BoundsExpansion - bounding volume의 expand 양(?)


//SpatialMappingManager.Instance.GetMeshFilters() 의 MeshFilter.sharedMesh.vertices


SurfaceMeshesToPlanes.cs - PlaneFinding 플러그인이 필요하며 PlaneFinding.cs를 이용하여 매핑 메쉬의 평면을 찾고, 만드는 컴포넌트

ActivePlanes - 매핑 데이터에서 찾은 평면들

SurfacePlanePrefab - 평면 생성시 사용할 GameObject. null이면 유니티 기본 cube

MinArea - 평면이 생성되는데 필요한 최소 구역(Area)

DrawPlanes - 랜더할 평면 타입(벽, 바닥, 천장)을 명시하는 Bit 마스크

DestroyPlanes - 무시할 평면 타입을 명시하는 Bit 마스크


SurfacePlane.cs - 평면을 생성하고, 타입을 지정(벽, 천장, 바닥, 테이블, 알수없음) SurfaceMeshesToPlane를 사용하는 SurfacePlanePrefab의 컴포넌트여야함(?)

PlaneThickness - 각 평면의 두께

UpNormalThreshold - normal의 임계값 > 평면이 수평인지 수직인지 판단할 때 사용

FloorBuffer - 수평 평면이 테이블로 명시되기 전에 가장 큰 바닥평면으로부터의 최대 거리

CeilingBuffer - 수평 평면이 테이블로 명시되기 전에 가장 큰 천장평면으로부터의 최대 거리

WallMaterial - 벽 플레인을 랜더링할 때 사용할 메터리얼

FloorMaterial - 바닥 플레인을

CeilingMaterial - 천장 플레인을

TableMaterial - 테이블 플레인을

UnkownMaterial - 알수없음 플레인을



Shaders



+ Recent posts