From 186bfae321f9d34b702a7c31b420eed4d10e7a50 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 19 Sep 2021 21:02:52 +0200 Subject: Small changes to channel example --- tangle/LLBM/sdf.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tangle/LLBM') diff --git a/tangle/LLBM/sdf.h b/tangle/LLBM/sdf.h index 656c109..52db8cf 100644 --- a/tangle/LLBM/sdf.h +++ b/tangle/LLBM/sdf.h @@ -63,6 +63,15 @@ __device__ __host__ float sintersect(float a, float b, float k) { return lerp(b, a, h) + k*h*(1.f-h); } +__device__ __host__ float3 twisted(float3 p, float k) { + float c = cos(k*p.y); + float s = sin(k*p.y); + float3 q = make_float3(0,0,p.y); + q.x = p.x*c + p.z*-s; + q.y = p.x*s + p.z* c; + return q; +} + } template -- cgit v1.2.3