8#ifndef DESIGNLAB_DXLIB_UTIL_H_
9#define DESIGNLAB_DXLIB_UTIL_H_
37 return VGet(vec.
x, -vec.
y, vec.
z);
63 return Vector3(vec.x, -vec.y, vec.z);
77void DrawCube3D(
const VECTOR& center_pos,
float side_len,
unsigned int color);
85 const VECTOR& top_pos,
float side_len,
unsigned int color);
92void DrawHexagon(
const std::array<VECTOR, 6>& vertex,
unsigned int color);
100 const std::array<VECTOR, 6>& vertex,
float height,
unsigned int color);
110constexpr VECTOR
operator+(
const VECTOR& vec1,
const VECTOR& vec2)
112 return { vec1.x + vec2.x, vec1.y + vec2.y, vec1.z + vec2.z };
115constexpr VECTOR
operator-(
const VECTOR& vec1,
const VECTOR& vec2)
117 return { vec1.x - vec2.x, vec1.y - vec2.y, vec1.z - vec2.z };
120constexpr VECTOR
operator*(
const VECTOR& vec,
const float s)
122 return { vec.x * s, vec.y * s, vec.z * s };
125constexpr VECTOR
operator*(
const float s,
const VECTOR& vec)
130constexpr VECTOR
operator/(
const VECTOR& vec,
const float s)
132 return { vec.x / s, vec.y / s, vec.z / s };
constexpr VECTOR operator-(const VECTOR &vec1, const VECTOR &vec2)
constexpr VECTOR operator+(const VECTOR &vec1, const VECTOR &vec2)
constexpr VECTOR operator/(const VECTOR &vec, const float s)
constexpr VECTOR operator*(const VECTOR &vec, const float s)
Dxlibの3D表示を行う処理を書き直した関数をまとめた名前空間.
Vector3 ConvertDesignLabVec(const VECTOR &vec)
このプログラムで使用しているVectorと, Dxlibの座標を示す VECTOR を変換する. ロボット座標系は右手座標系, Dxlibは左手座標系(工学は右手・ゲームライブラリは左手が多い) な...
void DrawCube3DWithTopPos(const VECTOR &top_pos, const float side_len, const unsigned int color)
3D空間に立方体を描画する.立方体の上面の中心の座標から描画する.
void SetZBufferEnable()
デフォルトだと描画処理を書いた順に描画されるが, これをZバッファを使用して奥行きを考慮して描画するようにする. 毎フレーム実行する必要がある.
void InitDxlib3DSetting(const bool high_quality)
3D処理を行う上で必要な初期化処理をまとめたもの.
MATRIX ConvertToDxlibMat(const RotationMatrix3x3 &mat)
このプログラムで使用しているMatrixを, Dxlibの行列を示すMATRIXに変換する.
void DrawHexagon(const std::array< VECTOR, 6 > &vertex, const unsigned int color)
3D空間に六角形を描画する.
VECTOR ConvertToDxlibVec(const Vector3 &vec)
Dxlibの座標を示すVECTORと,このプログラムで使用しているVectorを変換する. ロボット座標系は右手座標系, Dxlibは左手座標系(工学は右手・ゲームライブラリは左手が多い)なのでyを...
void DrawHexagonalPrism(const std::array< VECTOR, 6 > &vertex, const float height, const unsigned int color)
3D空間に六角柱を描画する.
void DrawCube3D(const VECTOR ¢er_pos, const float side_len, const unsigned int color)
3D空間に立方体を描画する.
std::array< std::array< float, 3 >, 3 > element