Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Porting Piccolo to Canvas
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
lucasjordan  
View profile  
 More options May 4 2010, 3:32 pm
From: lucasjordan <lucasjor...@gmail.com>
Date: Tue, 4 May 2010 12:32:26 -0700 (PDT)
Local: Tues, May 4 2010 3:32 pm
Subject: [piccolo2d-dev] Porting Piccolo to Canvas
I seem to have started down a possibly foolish path and I wanted to
get some feedback. I have started porting Piccolo to the new HTML5
Canvas API. Mind you I am only a few hours into this, but here are my
thoughts up to this point.

After reviewing the Canvas API I noticed that it is rather similar to
Graphics2D, which makes sense since it is solving a similar problem;
writing raster graphics. I have not had the chance to do a feature by
feature comparison, so there is probably something missing which will
bit me down the road.

After looking at the implementation of a number of the PNode
subclasses, it looked to me like a number of them could use Canvas to
accomplish at least a similar visual effect. Things like PImage and
PPath looks like they should work and hopefully PText will work as
well. I suspect PHtmlView will never work, but maybe that's ok.

Basically I am using GWT to take as much of the Java Code from
Piccolo2D  and use the project gwt-canvas to provide the Graphics2D
type functionality. Since Piccolo depends so heavily on java.awt and
java.awt.geom and the awt packages are not supported in GWT I am
including a copy of those source files in the GWT project. For
example, Piccolo depends on java.awt.Rectangle, so I copy the existing
Rectangle class to a java.gwt.Rectangle and simply change the import
statement in the Piccolo code.

Copying the awt classes looks like it is going to work in general but
there are few problems which have shown themselves. First, most of the
geometry type classes (Rectangle2D, Point2D, etc) only depend on them
selves and java.lang.Math, so this makes them viable classes to be
used with GWT, but some of them depends on internal sun.java.bla.bla.*
classes, which I don't currently have the source code for. The second
problem as I have not had a chance to review the legal issue in
reusing Oracle's code in this way. I has occurred to me I might have
better luck taking the code from Apache's project harmony, but again I
have not gotten that far. For that matter I am not sure about altering
the Piccolo2D code either.

It is my intention to make all of the work I am going here as free as
possible, so if someone has some experience with this, helping me make
sure that everyone's licenses are being properly honored, please let
me know.

Another concern of mine is that Piccolo does a lot more than just draw
a scene, it also provides node picking and other input events, I am
not sure how well that is going to work. A HTML5 Canvas element is
able to receive mouse and keyboard events, I just don't know if those
will be descriptive enough work with the existing Piccolo APIs.

Another issue is that JavaScript (which GWT code ultimately becomes)
does not support a double precision floating point values. GWT allows
you to use Java doubles in your code, but behind the scene they are
actually using two single precision float values to store the data and
they do some magic to manage those values for you. It is stated in the
GWT docs that this includes some overhead. So, since I am basically
copying all of the awt classes, I could just turn every double into a
float and then do the same to the piccolo code.... I have not started
doing this, but this is another topic I would like some feedback on.

So those are basically my technical concerns up to this point. But you
might be asking, "why are you doing this?" and basically it comes down
creating a cross platform scene graph API. I have worked with Piccolo
in the past and know that it is a solid scene graph API. I have also
worked a lot with JavaFX and know that that brings an excellent scene
graph API as well, plus it has properties and value binding, it is a
real pleasure to work with. But both of these APIs are dependent on
the presence of a modern JVM and frankly I don't see a real JVM
showing up on the devices I want to develop for. But on all of the
devices I want to developer for there is HTML5 compliant browser, this
includes, all desktop computers, Apple's i products, set top boxes,
Android and any other future google device, and many more.

I considered SVG, which also has pretty good cross platform support,
but there are limitations, especially coming from the Microsoft side
of things which claim they will not be including the animation
features.

Anyway, thanks for reading all this, I would love to get a reality
check here :)

-Lucas

Resources:
http://www.piccolo2d.org/
http://code.google.com/webtoolkit/
http://code.google.com/p/gwt-canvas/
http://harmony.apache.org/

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
allain  
View profile  
 More options May 4 2010, 3:48 pm
From: allain <allain.lalo...@gmail.com>
Date: Tue, 4 May 2010 12:48:56 -0700 (PDT)
Local: Tues, May 4 2010 3:48 pm
Subject: [piccolo2d-dev] Re: Porting Piccolo to Canvas
Hi Lucas,

I'm glad someone else has some interest in pushing piccolo2d in that
direction.

You may want to take a look at the source code in the repo there's an
entire branch dedicated to doing pretty much what you're talking
about: http://code.google.com/p/piccolo2d/source/browse#svn/piccolo2d.js/trunk

You may also want to see it in action at http://www.machete.ca/piccolo2d.js/

I'd love to collaborate on pushing it forward.

Let me know,

Allain Lalonde

On May 4, 3:32 pm, lucasjordan <lucasjor...@gmail.com> wrote:

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Heuer  
View profile  
 More options May 4 2010, 3:50 pm
From: Michael Heuer <heue...@gmail.com>
Date: Tue, 4 May 2010 14:50:15 -0500
Local: Tues, May 4 2010 3:50 pm
Subject: Re: [piccolo2d-dev] Porting Piccolo to Canvas

lucasjordan wrote:
> I seem to have started down a possibly foolish path and I wanted to
> get some feedback.

Nothing foolish about this -- several piccolo developers have thoughts
in this direction as well.

> I have started porting Piccolo to the new HTML5 Canvas API.

See also

http://code.google.com/p/piccolo2d/source/browse#svn/piccolo2d.js/trunk

> Basically I am using GWT to take as much of the Java Code from
> Piccolo2D  and use the project gwt-canvas to provide the Graphics2D
> type functionality. Since Piccolo depends so heavily on java.awt and
> java.awt.geom and the awt packages are not supported in GWT I am
> including a copy of those source files in the GWT project. For
> example, Piccolo depends on java.awt.Rectangle, so I copy the existing
> Rectangle class to a java.gwt.Rectangle and simply change the import
> statement in the Piccolo code.

I don't think copying java code through GWT is the right direction to
go.  If you're planning on writing javascript, write it directly.
There are several vis libraries written on javascript already,
including

Protovis
http://vis.stanford.edu/protovis/

Processing.js
http://processingjs.org/

JavaScript InfoVis Toolkit
http://thejit.org/

> Copying the awt classes looks like it is going to work in general but
> there are few problems which have shown themselves. First, most of the
> geometry type classes (Rectangle2D, Point2D, etc) only depend on them
> selves and java.lang.Math, so this makes them viable classes to be
> used with GWT, but some of them depends on internal sun.java.bla.bla.*
> classes, which I don't currently have the source code for. The second
> problem as I have not had a chance to review the legal issue in
> reusing Oracle's code in this way. I has occurred to me I might have
> better luck taking the code from Apache's project harmony, but again I
> have not gotten that far. For that matter I am not sure about altering
> the Piccolo2D code either.

Piccolo2D's license is clear.  So is Project Harmony's.  Using JDK
code is much more iffy.

   michael

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lucas Jordan  
View profile  
 More options May 4 2010, 6:04 pm
From: Lucas Jordan <lucasjor...@gmail.com>
Date: Tue, 4 May 2010 18:04:03 -0400
Local: Tues, May 4 2010 6:04 pm
Subject: Re: [piccolo2d-dev] Porting Piccolo to Canvas

Thanks you for those links to those other tools. They look very promising.
In general I agree that working through GWT is the wrong way to go, since a
'native' javascript can always be wrapped by GWT anyway. I was just hoping
to get a familiar API up and running quickly. Looking at the existing
Piccolo.js stuff, that looks very promising as well.

I will have to spend some time evaluating these new (to me) libraries and
piccolo.js.

Thanks
-Lucas

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Quartz  
View profile  
 More options Apr 22 2012, 12:12 am
From: Quartz <william.qua...@gmail.com>
Date: Sat, 21 Apr 2012 21:12:21 -0700 (PDT)
Local: Sun, Apr 22 2012 12:12 am
Subject: Re: [piccolo2d-dev] Re: Porting Piccolo to Canvas

Hi Lalonde,

I have been using Piccolo2D for several years and recently was interested
in a javascript version. I pulled down piccolo2d.js and it seems to work.

I was wondering what the current state of it was. I noticed there hasn't
been any activity on it since 2010. Has the community kinda of given up on
it or is something else replaced it? I have checked out several other
javascript scene graphs but I am still kind-of partial to piccolo2d.

Cheers.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »