Does PCanvas support multiple PCameras to obtain different views for the same PNode?

22 views
Skip to first unread message

Paul Peng

unread,
Nov 3, 2014, 10:18:17 PM11/3/14
to piccolo...@googlegroups.com
Dear all, 

I'm a NewBee to piccolo and I really enjoy to play with it in Java. I'd like to ask whether PCanvas support multiple PCameras to obtain different views for the same PNode ?

When I read the Piccolo Pattern in home page, I noticed it said "Each PCanvas is associated with a PCamera. But all cameras are not necessarily directly associated with a PCanvas." Is it mean a PCanvas actually can have or assigned multiple PCamera ?

Thank you for your time and suggestion.

Heiko Haller

unread,
Nov 4, 2014, 4:18:32 AM11/4/14
to Paul Peng, piccolo...@googlegroups.com
Dear Paul, 

maybe this is confusing you: PCanvas is _not_ the background, where PNodes sit an where the PCamera(s) look onto. In Piccolo2d, his background, elsewhere often called a “canvas” is a PLayer. 
A PCanvas is a Swing Canvas, it is the viewport that a PCamera projects to. Like a screen, that shows to the user, what the camera sees.

So: Yes, there can be multiple PCameras showing different views of a PNode. But you would either need to use multiple PCanvases as well, that show those two views – Like having multiple screens or a split-screen setting. Or, instead of projecting to a PCanvas, a PCamera can also show its picture in another PNode. That would compare to showing someone watching a screen that shows the other view.

Hope that helps, and I did not confuse you.

Cheers - Heiko
--
You received this message because you are subscribed to the Google Groups "Piccolo2D Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to piccolo2d-use...@googlegroups.com.
To post to this group, send email to piccolo...@googlegroups.com.
Visit this group at http://groups.google.com/group/piccolo2d-users.
For more options, visit https://groups.google.com/d/optout.

-- 
Dr. Heiko Haller | Schützenstr. 8a, D-76137 Karlsruhe | +49- 721 - 20 85 100 | http://heikohaller.de/

Paul Peng

unread,
Nov 4, 2014, 6:11:02 AM11/4/14
to piccolo...@googlegroups.com, paulpen...@gmail.com
Dear Haller, 

Thank you for your time. You did explain clean. Please correct me if I summarize wrong here. 

1) PCanvas like screen not background in Piccolo2D
2) PCamera will project to PCanvas to show the user what it looks at
3) Thus, If I want to have a different views of a PNode. I can use multiple PCameras watch different parts of the PNode, and projects to multiple PCanvases.

Cheers

Heiko Haller

unread,
Nov 4, 2014, 6:12:47 AM11/4/14
to Paul Peng, piccolo...@googlegroups.com, paulpen...@gmail.com
correct.

Paul Peng

unread,
Nov 4, 2014, 6:12:52 AM11/4/14
to Heiko Haller, piccolo...@googlegroups.com
Dear Haller, 

Thank you for your time. You did explain clean. Please correct me if I summarize wrong here. 

1) PCanvas like screen not background in Piccolo2D
2) PCamera will project to PCanvas to show the user what it looks at
3) Thus, If I want to have a different views of a PNode. I can use multiple PCameras watch different parts of the PNode, and projects to multiple PCanvases.

Cheers

Paul Peng

unread,
Nov 4, 2014, 6:31:47 AM11/4/14
to Heiko Haller, piccolo...@googlegroups.com
Dear Haller,

Thank you for your clarify again. 

I read other post in the Piccolo2D group, it mentioned the BirdsEyeViewExample.java is a good example to learn multiple views. I did some adjusts to source codes based on your suggestions just now. If you are convenient, please take a look and point out whether I'm at the right track. 

Thank you for your time and helps. :D

Cheers and Best regards 
Paul
BirdsEyeViewExample.java
Reply all
Reply to author
Forward
0 new messages