From 6fff6d556069a2a80f59415ceb320dacafa36d27 Mon Sep 17 00:00:00 2001 From: WanjieSun Date: Sat, 4 Jun 2016 23:24:18 +0800 Subject: [PATCH] fixed --- CMakeLists.txt | 6 ++++-- core/sampling.h | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e87b9b6..7499612 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,12 +21,14 @@ set(CMAKE_AUTORCC ON) set(RESOURCES_FILES qdarkstyle/style.qrc resources/images.qrc) #VTK -set(VTK_DIR /Volumes/Free/SDK/CTK/build/VTK-build) +#set(VTK_DIR /Volumes/Free/SDK/CTK/build/VTK-build) +set(VTK_DIR /Users/sunwj/Desktop/SDK/CTK/build/VTK-build) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) #CTK -set(CTK_DIR /Volumes/Free/SDK/CTK/build/) +#set(CTK_DIR /Volumes/Free/SDK/CTK/build/) +set(CTK_DIR /Users/sunwj/Desktop/SDK/CTK/build) find_package(CTK REQUIRED) include(${CTK_USE_FILE}) set(CTK_LIBRARIES CTKCore CTKWidgets CTKVisualizationVTKCore CTKVisualizationVTKWidgets) diff --git a/core/sampling.h b/core/sampling.h index 32e132c..7911b01 100644 --- a/core/sampling.h +++ b/core/sampling.h @@ -25,7 +25,10 @@ __inline__ __device__ glm::vec2 uniform_sample_unit_disk(curandState& rng) // return x and y in cartesian coordinate __inline__ __device__ glm::vec2 uniform_sample_disk(curandState& rng, float r) { - return glm::vec2(cosf(2.f * M_PI * curand_uniform(&rng)), sinf(sqrtf(curand_uniform(&rng)))) * r; + r *= sqrtf(curand_uniform(&rng)); + float theta = 2.f * M_PI * curand_uniform(&rng); + + return glm::vec2(cosf(theta), sinf(theta)) * r; } // return direction in cartesian space