This repository has been archived on 2025-09-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
XericLibrary-OLD/Runtime/MicroLibrary/MacroTransferAxes.cs

53 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Xeric.Runtime.MicroLibrary
{
/// <summary>
///
/// </summary>
/// <remarks>
/// 坐标系统换算库
/// </remarks>
public static class MacroTransferAxes
{
#region
/**
* 像Maya就是Y向上的三维软件它原来属于Silicon Graphice,Inc.的硬件开发使用的也是SGI的标准
* 以及DX,OpenGL也是使用Z缓冲区之类的名称来处理屏幕空间渲染。
* Unity,Zbrush,DirectX使用的是Y轴向上的左手坐标系
* Maya,OpenGL使用的是Y轴向上的右手坐标系
*
* 像Unreal诞生时Maya还没诞生大家都用的是3D Max所以采用了Z轴向上的左手坐标系。
* 另外3D Maxsource enginecry engine, blender使用的是Z轴向上的右手坐标系
*
* 数学上可能左手会好些
*/
/// <summary>
/// 将Y轴向上的坐标系转为Z轴向上的坐标系
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static Vector3 YupToZupAxes(Vector3 input)
{
return new Vector3(input.x, input.y, input.z);
}
/// <summary>
/// 将Z轴向上的坐标系转为Y轴向上的坐标系
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static Vector3 ZupToYupAxes(Vector3 input)
{
return new Vector3(input.x, input.y, input.z);
}
#endregion
}
}