15 float height = (
A -
B).Length();
16 vec3 height_dir = (
A -
B).Normalized();
17 vec3 height_dir_90 =
vec3 { -height_dir.
Y, height_dir.
X, height_dir.
Z };
18 vec3 guide = height_dir_90 - height_dir;
19 float cos_alpha = height_dir_90.
Dot(guide);
20 float sin_alpha = sqrt(1 - cos_alpha * cos_alpha);
23 for (
int i = 0; i <= Slices; i++)
25 float t = (float)i / Slices;
36 normal, tangent, bitangent,
vec2 { t, 0 }
40 normal, tangent, bitangent,
vec2 { t, 1 }
static matr4 Rotate(vec3< float > Axis, degrees< float > Angle)
vec3< T > TransformVector(const vec3< T > &V) const
T Dot(const vec3 &Other) const
vec3 Cross(const vec3 &Other) const
std::vector< vertex > Vertices
cone(const vec3 &A, float R1, const vec3 &B, float R2, int Slices)
Topology cone object class definition module.
Sculpto library prehompiled header. Defines common definitions, includes commonly used modules.