tChanged eye pos - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit a30ba0b562e0396a5701b8addc43f800aad4c383
(DIR) parent 1df0c98d05ea3b5f5abc169431d94cf5c7d6c480
(HTM) Author: Anders Damsgaard <adc@geo.au.dk>
Date: Wed, 19 Dec 2012 11:10:30 +0100
Changed eye pos
Diffstat:
M src/raytracer.cuh | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/src/raytracer.cuh b/src/raytracer.cuh
t@@ -402,9 +402,10 @@ __host__ void DEM::render(
// Initialize camera values and transfer to constant memory
float imgw = grid.L[0]*1.35f; // Screen width in world coordinates
float3 lookat = maxPos() / 2.0f; // Look at the centre of the mean positions
- float3 eye = make_float3(grid.L[0] * 0.5f,
+ float3 eye = make_float3(
+ grid.L[0] * 2.3f,
grid.L[1] * -5.0f,
- grid.L[2] * 0.5f);
+ grid.L[2] * 1.3f);
cameraInit(eye, lookat, imgw, focalLength);
// Construct rays for perspective projection
t@@ -415,7 +416,6 @@ __host__ void DEM::render(
Float* linarr; // Linear array to use for color visualization
Float* dev_linarr; // Device linear array to use for color visualization
- cudaMalloc((void**)&dev_linarr, np*sizeof(Float));
checkForCudaErrors("Error during cudaMalloc of linear array");
std::string desc; // Description of parameter visualized
std::string unit; // Unit of parameter values visualized
t@@ -494,6 +494,8 @@ __host__ void DEM::render(
// Copy linarr to dev_linarr if required
if (transfer == 1) {
+ cudaMalloc((void**)&dev_linarr, np*sizeof(Float));
+ checkForCudaErrors("Error during cudaMalloc of linear array");
cudaMemcpy(dev_linarr, linarr, np*sizeof(Float), cudaMemcpyHostToDevice);
checkForCudaErrors("Error during cudaMemcpy of linear array");
}