WorldToScreen
Overloads
| Name | Description |
|---|---|
| WorldToScreen(float x, float y, float z) | 3D World 좌표계를 2D 좌표(화면 좌표) 반환 |
| WorldToScreen(Vertex3D world) | 3D World 좌표계를 2D 좌표(화면 좌표) 반환 |
WorldToScreen(float x, float y, float z)
public Vertex3D WorldToScreen(float x, float y, float z)
3D World 좌표계를 2D 좌표(화면 좌표) 반환
Parameters
| Name | Type | Description |
|---|---|---|
| x | float | X 좌표 |
| y | float | Y 좌표 |
| z | float | Z 좌표 |
Returns
| Type | Description |
|---|---|
| Vertex3D | 2D 좌표(화면 좌표) |
Examples
// VIZCore3DX.NET Control
private VIZCore3DX.NET.VIZCore3DXControl vizcore3dx;
public void Example()
{
// 3D 위치가 화면 어디에 그려지는지 계산하여, 그 자리에 WinForms 컨트롤을 배치합니다.
List<VIZCore3DX.NET.Data.Node> nodes
= vizcore3dx.Object3D.FromFilter(VIZCore3DX.NET.Data.Object3dFilter.SELECTED_TOP);
if (nodes.Count == 0) return;
VIZCore3DX.NET.Data.Vertex3D center = vizcore3dx.Object3D.GetCenter(nodes);
VIZCore3DX.NET.Data.Vertex3D screen
= vizcore3dx.View.WorldToScreen(center.X, center.Y, center.Z);
System.Diagnostics.Debug.WriteLine(screen.X + " , " + screen.Y);
}
See also
WorldToScreen(Vertex3D world)
public Vertex3D WorldToScreen(Vertex3D world)
3D World 좌표계를 2D 좌표(화면 좌표) 반환
Parameters
| Name | Type | Description |
|---|---|---|
| world | Vertex3D | 3D World 좌표 |
Returns
| Type | Description |
|---|---|
| Vertex3D | 2D 좌표(화면 좌표) |
Examples
// VIZCore3DX.NET Control
private VIZCore3DX.NET.VIZCore3DXControl vizcore3dx;
public void Example()
{
// 3D 지점의 화면 좌표를 구해, 그 위치의 개체를 다시 조회합니다.
if (vizcore3dx.View.SelectSpatialPosition == null) return;
VIZCore3DX.NET.Data.Vertex3D screen
= vizcore3dx.View.WorldToScreen(vizcore3dx.View.SelectSpatialPosition.ToVertex3D());
VIZCore3DX.NET.Data.Node node
= vizcore3dx.Object3D.FromScreen((int)screen.X, (int)screen.Y);
if (node == null) return;
System.Diagnostics.Debug.WriteLine(node.NodeName);
}