Loading...
Logo
Processing Forum

Hi,

The size of my sketch in void setup() is

size(1100,700,P3D);

I want to do something to make just for example the coordinate (100,100, 200,400) P3D.

In another word, I don’t want all my sketch be P3D.

(Imagine a sketch that half of it is simple and just showing some simple text and the other half is showing a 3D animation.)

Is there such a thing and can I do that?

I hope could make my question clear.

Replies(3)



@ emily.m: I am not sure if you have a real problem there. Maybe it's working already.

I think when you have

Copy code
  1. size(1100,700,P3D);

you can paint your 3D stuff at 100,100

and in other parts just use 2D commands such as text, line (2D), rect etc. as usual (as if you had P2D).

So it's not necessary to have 2D and 3D parts on the screen because you can mix them anyway.

Give it a try!


For text you can also use textMod
e(SCREEN);  this makes sure the text is right in front of you even when weird 3D is stuff is going on elsewhere.

Remark:
It gets more complicate when you use peasycam (but it has a Head-up display to make parts of the screen fixed - I think its with   cam.beginHUD();  etc.  - see http://en.wikipedia.org/wiki/Head-up_display )

Greetings, Chrisir  



P.S.
see here, when go to page 2 in the book (with cursor right) you see a 3D box there in a 2D context
(enlarge the screen with the icon lower right corner below the program)
http://www.openprocessing.org/sketch/49173

The thing that I like very much in programming is that there are lots of different ways to do the same thing and have the same result we want!

I took my chance using PGraphics.

 
Yes. See:  PGraphics  &  createGraphics() .  

It worked well for me, but I’m going to use the way of mixing P3D and P2D for other parts just like your example Chrisir .

I’m sure I will stick again somewhere, it the property of programming.

Thanks guys