From bec8869883710493ddf2fd88ae79c3befe41dc9b Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 10 Mar 2013 21:36:01 +0000 Subject: Debut implementation du refresh automatique (style game loop) si demandé (mouse1 down) compil.sh : -lrt est nécessaire pour avoir des infos précises sur le timing (kernel exec time...) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2013-gpudataviz/trunk@22 371a6b4a-a258-45f8-9dcc-bdd82ce0ac9d --- src/opencl_mesh_kit.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/opencl_mesh_kit.hpp') diff --git a/src/opencl_mesh_kit.hpp b/src/opencl_mesh_kit.hpp index ee6bfa5..ac3cf46 100644 --- a/src/opencl_mesh_kit.hpp +++ b/src/opencl_mesh_kit.hpp @@ -56,13 +56,13 @@ const char kernel_src_zero_z[]=STRINGIFY( /* calculate uv coordinates of the mesh point [0.0;1.0] */ float u = nx / (float) width; float v = ny / (float) height; - /* calculate centered coordinates [-0.5;0.5] */ - float x = (u*2-1)/2; - float y = (v*2-1)/2; - /* We only use normalized quaterinons here */ - float w = 1.0f; + /* calculate centered normalized coordinates [-1.0;1.0] */ + float x = u*2.0-1.0; + float y = v*2.0-1.0; /* Calculate the desirated value of the mesh point */ float z = 0.0f; + /* We only use normalized quaterinons here */ + float w = 1.0f; /* Write output vertex (centered) */ pos[ny*width+nx] = (float4)(x, y, z, w); } -- cgit v1.2.3