arrayfire / forge

High Performance Visualization
224 stars 48 forks source link

3D Plot does not render out of grid position (0,0) #111

Closed shehzan10 closed 8 years ago

shehzan10 commented 8 years ago

git diff to reproduce code using plot3.cu

diff --git a/examples/cuda/plot3.cu b/examples/cuda/plot3.cu
index 4c7a7f1..20e3fc1 100644
--- a/examples/cuda/plot3.cu
+++ b/examples/cuda/plot3.cu
@@ -37,6 +37,7 @@ int main(void)
      */
     forge::Window wnd(DIMX, DIMY, "Three dimensional line plot demo");
     wnd.makeCurrent();
+    wnd.grid(2, 1);

     forge::Chart chart(FG_CHART_3D);
     chart.setAxesLimits(-1.1f, 1.1f, -1.1f, 1.1f, 0.f, 10.f);
@@ -63,7 +64,9 @@ int main(void)
         t+=0.01;
         kernel(t, DX, dev_out);
         copyToGLBuffer(handle, (ComputeResourceHandle)dev_out, plot3.verticesSize());
-        wnd.draw(chart);
+        wnd.draw(0, 0, chart);
+        wnd.draw(1, 0, chart);
+        wnd.swapBuffers();
     } while(!wnd.close());

     FORGE_CUDA_CHECK(cudaFree(dev_out));

Same changes can be made to CPU and OpenCL with same bug.

shehzan10 commented 8 years ago

Looks like vector field 3d (using stream example) is also facing a similar issue.

9prady9 commented 8 years ago

Well, the problem is not just with 3d plot and stream. If i pass the same chart to render in two different views, the chart is getting rendered to the first view only.

shehzan10 commented 8 years ago

The way I was testing was different. I actually have image, histogram, plot2d and plot3d in the swe example in ArrayFire. And only plot3 was not getting rendered. But got rendered fine when I put it at (0, 0).

9prady9 commented 8 years ago

So, i ran the code for all renderable objects and same problem everywhere.

9prady9 commented 8 years ago

Yes, i saw that issue too. It was in swe example.

shehzan10 commented 8 years ago

But in the swe example, all of them have different chart objects.

9prady9 commented 8 years ago

it may be related to chart at all based on what i am seeing now. Because if i render same object second time, it is simply not rendering to another view.