MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / createCube

Function createCube

cpp/4_CUDA_Libraries/randomFog/randomFog.cpp:96–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94const float PI = 3.14159265359f;
95
96void createCube(void)
97{
98 int startVertex = 0;
99
100 for (int i = startVertex; i < g_nVerticesPopulated; i++) {
101 g_pVertices[i].x = (g_pRng->getNextU01() - .5f) * 2;
102
103 for (int j = 0; j < nSkip1; j++) {
104 g_pRng->getNextU01();
105 }
106
107 g_pVertices[i].y = (g_pRng->getNextU01() - .5f) * 2;
108
109 for (int j = 0; j < nSkip2; j++) {
110 g_pRng->getNextU01();
111 }
112
113 g_pVertices[i].z = (g_pRng->getNextU01() - .5f) * 2;
114
115 for (int j = 0; j < nSkip3; j++) {
116 g_pRng->getNextU01();
117 }
118
119 g_pVertices[i].r = 1.0f;
120 g_pVertices[i].g = 1.0f;
121 g_pVertices[i].b = 1.0f;
122 }
123}
124
125void createPlane(void)
126{

Callers 2

reCreateFunction · 0.85
keyboardFunction · 0.85

Calls 1

getNextU01Method · 0.80

Tested by

no test coverage detected