We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
I would like add a P2D layer over another with P3D render; the problem is that the 3d object intersect in Z axis with the P2D layer, and the light is influecing the P2D layer.
The question is if there are a method for put the 2d layer always over the 3d and if I make the light ingnored the p2d layer...
very thanks! muy first post!
Answers
The simplest solution I can think of:
In setup(): Set your main renderer to P2D and create an P3D offscreen buffer.
In draw(): Render the 3D stuff to the offscreen buffer, render the offscreen buffer to the main canvas, render all 2D stuff to the main canvas.
Example:
Thank you!
The solution is good, what happens is that I'm using the library Objloaders from saito, and I can not insert the library into a pgraphics, so the sketch is a p3d.
Thank you very much!
No problem. :)
I never used .OBJ loader, but I assume it uses the main canvas (this.g) as drawing surface, so swapping the g reference could do the trick:
yes....
I normally use size with OPENGL or so
then do 3D stuff
at the very end of draw() I say
hints do the trick
do 2D stuff rects / texts....
here...
thank you! I have tried both options but to Poersch worked at first, I was not able to solve the Chrisir (I'm newbie).
Thank you very much, greetings!