CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//#include <iostream>
#include <vector>
#include <array>
struct vec3f
{
float x, y, z;
vec3f()
: x(rand()/RAND_MAX),
y(rand()/RAND_MAX),
z(rand()/RAND_MAX) {}
};
struct model
{
// Vertices
std::vector<vec3f> v;
/* Vector of pointers that
/* form a triangular face */
std::vector<std::array<vec3f*,3>> t;
// Destructor
~model()
{
/* Should pointers be deleted
/* here and then clear the
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run