#define USE_FORGE_CPU_COPY_HELPERS
#include <complex>
#include <cmath>
#include <vector>
#include <iostream>
using namespace std;
static const float XMIN = -8.0f;
static const float XMAX = 8.f;
static const float YMIN = -8.0f;
static const float YMAX = 8.f;
const float DX = 0.5;
const size_t XSIZE = (XMAX-XMIN)/DX;
const size_t YSIZE = (YMAX-YMIN)/DX;
void genSurface(float dx, std::vector<float> &vec )
{
vec.clear();
for(float x=XMIN; x < XMAX; x+=dx){
for(float y=YMIN; y < YMAX; y+=dx){
vec.push_back(x);
vec.push_back(y);
float z = sqrt(x*x+y*y) + 2.2204e-16;
vec.push_back(sin(z)/z);
}
}
}
int main(void)
{
std::vector<float> function;
genSurface(DX, function);
do {
releaseGLBuffer(handle);
return 0;
}