Cube Primitive Definition
Hi, guys,
I want to define some 3D primitive nodes for our graphic engine. Cube Node is one of the basis primitive node in our design.
I am wondering, besides two vertex position, is there any other attribution I need to concern, such as axis vector, normal vector, etc.
Because the cube is in 3D space, only two points is not enough, we must consider its orientation. But I also need to keep the size of the definition as small as possible. What's your opinion?
My draft is
class CubeNode
{
public:
float mTopLeft[3];
float mBottomRight[3];
float mXAxisVector[3]; //X Axis Orientation
float mYAxisVector[3]; //Y Axis Orientation
}
Thanks!
class CubeNode{public: float dimensions[3]; // width, length and depth of the cube float position[3]; // world space position float rotation[3]; // rotation on each axis in radians}
you can also use:
Cube{ VECTOR3 Axis[3] //X,Y,Z normalize axis of the cube VECTOR3 Origin //Origin of cube in 3D space float Dimension[3] //Length of the X,Y,Z axis of the cube.}
Quote:Original post by littlekid
you can also use:Cube{ VECTOR3 Axis[3] //X,Y,Z normalize axis of the cube VECTOR3 Origin //Origin of cube in 3D space float Dimension[3] //Length of the X,Y,Z axis of the cube.}
in that case you only need the Up and Right vector for the axis
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement