Recent Posts

Pages: 1 ... 3 4 [5] 6 7 ... 10
41
Support / Render Scene to Texture - Questions/Possibility
« Last post by Jamiro on January 20, 2018, 05:56:36 pm »
Hello once again,

I've read about this particular possibility and I've tried it in the past but without any success. So I' will try it again this time until it works, so, my render loop is defined this way:

Code: [Select]
   while(run){
      //-- START RENDER WORLD --//
      BUFFER.clear(back_Color);
      BUFFER.setPaintListenerState(false);
     
      *1*
     
      WORLD.renderScene(BUFFER);
      WORLD.draw(BUFFER);
      //-- END RENDER WORLD --//
     
      draw2DElements(BLIT_OBJECTS, BUFFER);
     
      *2*
     
      BUFFER.setPaintListenerState(true);
      BUFFER.update();
      BUFFER.displayGLOnly();
      canvas.repaint();
     
      *3*
     
      Thread.sleep(delay);
   }

So my questions are these:

  • Can I use the same FrameBuffer to render the scene to the canvas and to a texture? If so, how? and where? at position 1, 2 or 3 in the code or other?

  • Can I use different FrameBuffers to render to texture as well? if so, what you suggest is better, using the same world or one world per framebuffer?

  • If I want to change this texture on the go, what is the best technique to do so, and the fastest way? using shaders ou can it be done by AWT graphics way?

  • And lastly, can I render it to a bitmap or any other image format in order to be saved as a file?


regards,
Jamiro
42
Support / Re: Interact2D
« Last post by EgonOlsen on January 20, 2018, 11:35:00 am »
You have to transform 2d space into 3d. Each point in 2d corresponds to an unlimited number of points in 3d, so you have to assume some point in 3d as fixed. And because we are talking about casting a day in camera space, that point has to be in camera space.
There might not be many uses for this method signature, but I added it later, so there had to be at least one.
43
Support / Re: Interact2D
« Last post by AGP on January 20, 2018, 06:26:31 am »
I went with the mouse-follow demo and ray-cast. It's working but, academically, I'd still like to know how to make use of the method which takes the camera z value.
44
Support / Re: Interact2D
« Last post by AGP on January 19, 2018, 06:52:08 pm »
So how do I get the plane's z in cameraspace?
45
Support / Re: Problem with rendering
« Last post by thejauffre on January 19, 2018, 06:16:55 pm »
I managed how to solve the problem.
Vuforia uses a custom shader to render the background plane, defined in their VideoBackgroundShader class.
In the vertex shader, I had just to add a translation along the z component of the gl_Position vector.
46
Support / Re: Problem with rendering
« Last post by thejauffre on January 19, 2018, 12:48:14 pm »
I think I understood this problem: Vuforia uses a plane, rendered with OpenGLES, where it draws the camera input. My impression is that this plane "cuts" the teapot when I move the device around the target, or shows nothing when the plane is between the camera and the target.
Vuforia creates the plane by using some JNI calls, and I don't know if I can set the distance between camera and plane; i'll contact their support forum, and bring here the solution (if any).
47
Support / Re: Interact2D
« Last post by EgonOlsen on January 19, 2018, 08:35:06 am »
But you need it to make the transition from 2d to 3d. You can't just make up the missing third component, you have to specify it. That's why there is this variant of the method that takes x,y in screen space and the depth in world space.
48
Support / Re: Mesh normals access
« Last post by EgonOlsen on January 19, 2018, 08:33:04 am »
49
Support / Mesh normals access
« Last post by Jamiro on January 19, 2018, 05:42:40 am »
Hello,

I have another question about this structure, which is the possibility to access the normals of a mesh, how can this be done? Can I change the normal of an arbitrary vertex? If so, how?

regards,
Jamiro
50
Support / Re: Interact2D
« Last post by AGP on January 18, 2018, 09:47:20 pm »
I don't need the height in wordspace. Only the x and the z.
Pages: 1 ... 3 4 [5] 6 7 ... 10