Loading...
Logo
Processing Forum

3d Model and 2d Gui combination

in General Discussion  •  Other  •  1 year ago  
hello there people,
I am developing a project where I want to have a 3d model, that I want to orbit (with a peasy cam probably) and also a part on the canvas that I will have some buttons. The problem that, when using PeasyCam or the camera() function, the buttons, or any 2d shapes cannot be set to something as screen mode that text has, and they float around like planes.

Is there a way, that with some pushMatrices or something else, that I can do that? exclude some stuff from peasy cam?
or in some way maintain part of the screen in 2d mode?
or toggle between the default camera and the peasy cam?
or even to put the GUI in a second canvas?

thanks in advance


Replies(2)

Actually peasycam has special methods for this:
Copy code
  1. camera.beginHUD();
  2. // now draw things that you want relative to the camera's position and orientation
  3. camera.endHUD();
For sketches that do not use peasycam check out code snippet number...

9. combining 2D and 3D drawing

...on my list of 25 life-saving tips for processing.

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. }

thank you. saved my life :)

another question.
when in peasyCam, do you know how I can do mouse-over functions?
basicly do you know what vectors I can use to do that?