Loading...
Logo
Processing Forum
Hi everyone. What is the best way to render 2d text (in the screen) while having things happening in 3d? 

I've tried with textmode(SCRREN) and it works fine with only the text but I don't achieve for example drawing 3d lines at the same time that the text is rendered on screen (draw the lines but in the xy plane). 

In addition I've read in the wiki that textMode it's going to dissapear in processing 2.0, so what is the best way from now on?

Thanks!

Replies(1)

Useful techniques are disabling the depth test with hint, resetting the camera(), turning off the lights, and sometimes using pushMatrix and popMatrix. Check out the following code snippet.
Copy code
  1. void draw() {
  2.   // 3D code
  3.   hint(DISABLE_DEPTH_TEST);
  4.   camera();
  5.   noLights();
  6.   // 2D code
  7.   hint(ENABLE_DEPTH_TEST);
  8. }