mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Simple program to define a surface.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
hellosurface
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# This is the default target, which will be built when
|
||||
# you invoke make
|
||||
.PHONY: all
|
||||
all: hellosurface
|
||||
|
||||
# This rule tells make how to build hellosurface from hellosurface.cpp
|
||||
hellosurface: hellosurface.cpp
|
||||
g++ -g -o hellosurface hellosurface.cpp
|
||||
|
||||
# This rule tells make to copy hellosurface to the binaries subdirectory,
|
||||
# creating it if necessary
|
||||
.PHONY: install
|
||||
install:
|
||||
mkdir -p binaries
|
||||
cp -p hellosurface binaries
|
||||
|
||||
# This rule tells make to delete hellosurface and hellosurface.o
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f hellosurface hellosurface.o
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Simple program to test a 3d surface.
|
||||
@@ -0,0 +1,31 @@
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <malloc.h>
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
|
||||
int main (void) {
|
||||
|
||||
float xyz[] = {
|
||||
0.0, 0.0, 3.0,
|
||||
1.0, 4.0, 0.0,
|
||||
0.0, 1.0, 0.0,
|
||||
4.0, 0.0, 3.0,
|
||||
1.0, 4.0, 7.0,
|
||||
0.0, 6.0, 0.0
|
||||
};
|
||||
|
||||
int npoints = sizeof(xyz) / (3 * sizeof(float));
|
||||
|
||||
printf("Hello surface!\n");
|
||||
printf("# points = %d\n", npoints);
|
||||
|
||||
for (int i=0,j=0; i<npoints; i++) {
|
||||
printf ("%3.1f %3.1f %3.1f\n", xyz[j], xyz[j+1], xyz[j+2]);
|
||||
|
||||
j += 3;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user