Home » Archived » GEF3D » Changes in GEF3D API
Changes in GEF3D API [message #468276] |
Tue, 04 August 2009 19:47 |
Kristian Duske Messages: 64 Registered: July 2009 |
Member |
|
|
Hi everyone,
I just merged and committed an experimental branch we were working on
to the trunk. In this branch, Jens and I reimplemented the picking
mechanism in GEF3D and cleaned up everything that had to do with
coordinate systems and coordinate conversion. Since I am running a
little low on time due to my thesis, I will just sum up the most
significant changes:
1. Picking
Up until now, we used a technique called color picking (similar to
OpenGL selection mode) to determine which figure was at a given set of
mouse coordinates. This technique worked well, but has the major flaw
that you can only find the frontmost figure at any given location. If
you want to know what's behind that figure, you have to re-render the
color and depth buffers, and with that comes a big performance penalty.
The problem here is that GEF allows you to limit your search for a
figure at a given location using an instance of TreeSearch. For
example, if you want to know whether there's a handle at a certain
location, you'd ignore everything but the handle layer.
To support this in GEF3D, we had to rewrite the picking mechanism. We
did away with the color picking and now use the geometric data of the
figures and shapes to find intersections with a picking ray. This works
very well, has the desired flexibility when it comes to limiting a
search and is very fast even in larger diagrams. There is only one
downside, and that is that every figure must now implement the
interface org.eclipse.draw3d.picking.Pickable and its method
public float getDistance(Query i_query);
This method basically calculates the point of intersection between a
ray (stored in the given query) and the figure itself. This puts a
burden on framework users because if they want to use their own
figures, they have to implement this method, which requires a good
understanding of 3D math and such. To alleviate this, we will expand
our library of basic shapes, which are all pickable, and we will make
it easier for figures to simply be composed of a number of basic shapes
by introducing a ShapeFigure which delegates all rendering to one or
more shapes. This figure will also delegate the intersection detection
to the shapes, which will all implement this efficiently.
But even if someone cannot use Shapes and needs to write their own
rendering code, they will find that Math3D contains a number of very
useful functions for intersection detection, most notably
rayIntersectsPolygon, which does most of the heavy lifting.
In addition to this, we plan won writing a figure that can load polygon
models and display them in GEF3D, which would make it possible for
framework users to create their figures in a 3D editor like Maya and
then use them directly in GEF3D without any coding at all!
We hope that these tools and the improved performance and flexibility
that the new picking method gives us will make up for the added burden
of possible writing 3D math. But as we said, we will do what we can to
keep the math away from the users ;-)
2. Coordinate systems
With the new picking, we have introduced a trio of coordinate systems
that GEF3D uses, including simple methods of converting between them.
All this will be explained in a Wiki article I'm writing here:
http://wiki.eclipse.org/GEF3D_Coordinate_Systems
The article is a work in progress and some of the information in there
is already out of date, but I will try to update it
tomorrow. The most important change we made is that
|
|
| | |
Re: Changes in GEF3D API [message #491839 is a reply to message #491816] |
Fri, 16 October 2009 06:48 |
Miles Parker Messages: 1341 Registered: July 2009 |
Senior Member |
|
|
I've made some progress on this -- really by accident, and now I'm not
sure that it's an API change issue at all -- or at least not directly.
What happened is that I've been trying to debug this launching into a
hosted runtime and executing the 3D test. By chance I happened to run a
regular model that used regular old GEF2D. *After* I ran that, in the
same session, suddenly everything worked fine!? But if I exit the
runtime, start back up and run the GEF3D first I again don't see
anything, just a blank space. Any ideas...? It seems like something low
level though OTOH it's possible I've messed something up on my end that
is preventing something in the edit part tree not getting loaded the
first time.
On 2009-10-15 16:45:43 -0700, Miles Parker <milesparker@gmail.com> said:
>
> Hi guys,
>
> I'm having a heck of a time getting things running after moving to the
> new API. I think I've followed the directions carefully -- the only
> difference is that I'm using a ViewPart instead of an EditPart. can you
> think of anything in the update mechanism that might be relevant to
> that? I noticed taht there was something about performRender not
> working the same way as before. My model component visualiztion updates
> happen after the visualziation is actually created of course so I need
> to trigger a redraw, and I'm not sure that's happening correctly.
>
> Sorry to be so vague...
>
> Miles
>
> On 2009-08-17 06:25:20 -0700, Jens v.P. <developer@jevopi.de> said:
>
>> We have now written a blog entry about the API changes:
>>
>> http://dev.eclipse.org/blogs/gef3d/2009/08/17/pick-me-rotate -me/
>>
>> Cheers,
>>
>> Jens
|
|
|
Re: Changes in GEF3D API [message #491851 is a reply to message #491839] |
Fri, 16 October 2009 08:10 |
Kristian Duske Messages: 64 Registered: July 2009 |
Member |
|
|
Dear Miles,
Jens is currently on vacation, but since a lot of the API changes were
made by me, I'll try to help you out. The problem is however that your
description is a bit vague and I don't know your code at all. Maybe
we'd get somewhere quicker if we could chat via messenger or something
like that. If you are interested, drop me an email with your Skype name
/ ICQ # or whatever and I'll get back to you ASAP. Also, is there an
easy way for me to download and test your plugin?
> I've made some progress on this -- really by accident, and now I'm not
> sure that it's an API change issue at all -- or at least not directly.
> What happened is that I've been trying to debug this launching into a
> hosted runtime and executing the 3D test. By chance I happened to run a
> regular model that used regular old GEF2D. *After* I ran that, in the
> same session, suddenly everything worked fine!? But if I exit the
> runtime, start back up and run the GEF3D first I again don't see
> anything, just a blank space. Any ideas...? It seems like something low
> level though OTOH it's possible I've messed something up on my end that
> is preventing something in the edit part tree not getting loaded the
> first time.
This sounds vaguely familiar. Does your code use GMF in any way?
Btw. regarding your previous message: The entire rendering system has
been changed and performRender() does no longer get called. Instead,
your figure has to implement
Renderable#collectRenderFragments(RenderContext). See also the
RenderFragment interface. The general idea is this: Instead of
rendering figures right away, the render context collects render
fragments from all figures. These fragments can render themselves and
they have a render type (transparent, superimposed, opaque or ignore).
This was done to ensure that everything is rendered in the correct
order (opaque with depth test, transparent with depth test and ordered
back to front, superimposed without depth test and ordered back to
front). So during painting the render fragments are collected and store
in the render context, and when the tree was entirely traversed, they
are sorted by their type and possibly their distance from the camera
and finally, they get rendered.
Best regards
Kristian
|
|
|
Re: Changes in GEF3D API [message #491980 is a reply to message #491851] |
Fri, 16 October 2009 21:14 |
Miles Parker Messages: 1341 Registered: July 2009 |
Senior Member |
|
|
Hi Kristian, see below..
On 2009-10-16 01:10:20 -0700, Kristian Duske
<kristian.duske@fernuni-hagen.de> said:
> Dear Miles,
>
> Jens is currently on vacation, but since a lot of the API changes were
> made by me, I'll try to help you out. The problem is however that your
> description is a bit vague and I don't know your code at all. Maybe
> we'd get somewhere quicker if we could chat via messenger or something
> like that. If you are interested, drop me an email with your Skype name
> /
Yes, sorry for the vagueness! I simply had no idea of what was broken
so that's why I was fishing. Now that I have something working that I
can actually see, I am not so stuck and I can play around a bit. I'll
send you my skype seperatly but it's quite late in .de now..
> ICQ # or whatever and I'll get back to you ASAP. Also, is there an
> easy way for me to download and test your plugin?
Yes, there is.. it's all in CVS:
see:
http://eclipse.org/amp/developers/building.php
http://eclipse.org/amp/developers/repositoryDetails.php
Then see...
http://wiki.eclipse.org/AMP/UserGuide/Escape/Getting_Started
You need to get Escape Exmaples from SVS, not download zip because of
recent changes..
http://ascape.svn.sourceforge.net/svnroot/ascape/org.ascape. escape.models.brook
Then if you import into self-hosted runtime and install above into it,
you should be able to just right-click on
org.ascape.escape.models.brook/src/edu.brook.pd.PD2_5D -- nothing will
happen I think. Then start PD2D, exit it and try the 2_5D version
again and it should work..
>
>> I've made some progress on this -- really by accident, and now I'm not
>> sure that it's an API change issue at all -- or at least not directly.
>> What happened is that I've been trying to debug this launching into a
>> hosted runtime and executing the 3D test. By chance I happened to run a
>> regular model that used regular old GEF2D. *After* I ran that, in the
>> same session, suddenly everything worked fine!? But if I exit the
>> runtime, start back up and run the GEF3D first I again don't see
>> anything, just a blank space. Any ideas...? It seems like something low
>> level though OTOH it's possible I've messed something up on my end that
>> is preventing something in the edit part tree not getting loaded the
>> first time.
>
> This sounds vaguely familiar. Does your code use GMF in any way?
No, I don't use GMF at all -- in fact I try to stay away from any
dependencies on UML, GMF, etc.. as it just brings too much stuff in
that I really don't want or need.
> Btw. regarding your previous message: The entire rendering system has
> been changed and performRender() does no longer get called. Instead,
> your figure has to implement
> Renderable#collectRenderFragments(RenderContext). See also the
> RenderFragment interface. The general idea is this: Instead of
> rendering figures right away, the render context collects render
> fragments from all figures. These fragments can render themselves and
> they have a render type (transparent, superimposed, opaque or ignore).
> This was done to ensure that everything is rendered in the correct
> order (opaque with depth test, transparent with depth test and ordered
> back to front, superimposed without depth test and ordered back to
> front). So during painting the render fragments are collected and store
> in the render context, and when the tree was entirely traversed, they
> are sorted by their type and possibly their distance from the camera
> and finally, they get rendered.
I read the very detailed treatment of the RenderFragment stuff. I'm
still a bit lost on it, but I think it makes sense it outline and I can
see that transparancy is working much better now. What I'm not clear on
is how I actually trigger a render event now. For performance I need to
be able to prevent rendering from occuring while I update the positions
of many many figures, and then update them all at once. I had been
doing that by updating contrainst manually all at once and then
invalidating the tree and calling perform render. But it sounds like
the new design will actually work much better for what I want to try to
do. In fact, I find myself removing a bunch of code, which is always a
good thing. Before you get too involved in checking things through I
shold probably experiment a bit more on my end. It might be something
as simple as an adapter not getting loaded correctly.
cheers,
Miles
|
|
| | | | | |
Re: Changes in GEF3D API [message #562947 is a reply to message #491816] |
Fri, 16 October 2009 06:48 |
Miles Parker Messages: 1341 Registered: July 2009 |
Senior Member |
|
|
I've made some progress on this -- really by accident, and now I'm not
sure that it's an API change issue at all -- or at least not directly.
What happened is that I've been trying to debug this launching into a
hosted runtime and executing the 3D test. By chance I happened to run a
regular model that used regular old GEF2D. *After* I ran that, in the
same session, suddenly everything worked fine!? But if I exit the
runtime, start back up and run the GEF3D first I again don't see
anything, just a blank space. Any ideas...? It seems like something low
level though OTOH it's possible I've messed something up on my end that
is preventing something in the edit part tree not getting loaded the
first time.
On 2009-10-15 16:45:43 -0700, Miles Parker <milesparker@gmail.com> said:
>
> Hi guys,
>
> I'm having a heck of a time getting things running after moving to the
> new API. I think I've followed the directions carefully -- the only
> difference is that I'm using a ViewPart instead of an EditPart. can you
> think of anything in the update mechanism that might be relevant to
> that? I noticed taht there was something about performRender not
> working the same way as before. My model component visualiztion updates
> happen after the visualziation is actually created of course so I need
> to trigger a redraw, and I'm not sure that's happening correctly.
>
> Sorry to be so vague...
>
> Miles
>
> On 2009-08-17 06:25:20 -0700, Jens v.P. <developer@jevopi.de> said:
>
>> We have now written a blog entry about the API changes:
>>
>> http://dev.eclipse.org/blogs/gef3d/2009/08/17/pick-me-rotate -me/
>>
>> Cheers,
>>
>> Jens
|
|
|
Re: Changes in GEF3D API [message #562961 is a reply to message #491839] |
Fri, 16 October 2009 08:10 |
Kristian Duske Messages: 64 Registered: July 2009 |
Member |
|
|
Dear Miles,
Jens is currently on vacation, but since a lot of the API changes were
made by me, I'll try to help you out. The problem is however that your
description is a bit vague and I don't know your code at all. Maybe
we'd get somewhere quicker if we could chat via messenger or something
like that. If you are interested, drop me an email with your Skype name
/ ICQ # or whatever and I'll get back to you ASAP. Also, is there an
easy way for me to download and test your plugin?
> I've made some progress on this -- really by accident, and now I'm not
> sure that it's an API change issue at all -- or at least not directly.
> What happened is that I've been trying to debug this launching into a
> hosted runtime and executing the 3D test. By chance I happened to run a
> regular model that used regular old GEF2D. *After* I ran that, in the
> same session, suddenly everything worked fine!? But if I exit the
> runtime, start back up and run the GEF3D first I again don't see
> anything, just a blank space. Any ideas...? It seems like something low
> level though OTOH it's possible I've messed something up on my end that
> is preventing something in the edit part tree not getting loaded the
> first time.
This sounds vaguely familiar. Does your code use GMF in any way?
Btw. regarding your previous message: The entire rendering system has
been changed and performRender() does no longer get called. Instead,
your figure has to implement
Renderable#collectRenderFragments(RenderContext). See also the
RenderFragment interface. The general idea is this: Instead of
rendering figures right away, the render context collects render
fragments from all figures. These fragments can render themselves and
they have a render type (transparent, superimposed, opaque or ignore).
This was done to ensure that everything is rendered in the correct
order (opaque with depth test, transparent with depth test and ordered
back to front, superimposed without depth test and ordered back to
front). So during painting the render fragments are collected and store
in the render context, and when the tree was entirely traversed, they
are sorted by their type and possibly their distance from the camera
and finally, they get rendered.
Best regards
Kristian
|
|
|
Re: Changes in GEF3D API [message #562988 is a reply to message #491851] |
Fri, 16 October 2009 21:14 |
Miles Parker Messages: 1341 Registered: July 2009 |
Senior Member |
|
|
Hi Kristian, see below..
On 2009-10-16 01:10:20 -0700, Kristian Duske
<kristian.duske@fernuni-hagen.de> said:
> Dear Miles,
>
> Jens is currently on vacation, but since a lot of the API changes were
> made by me, I'll try to help you out. The problem is however that your
> description is a bit vague and I don't know your code at all. Maybe
> we'd get somewhere quicker if we could chat via messenger or something
> like that. If you are interested, drop me an email with your Skype name
> /
Yes, sorry for the vagueness! I simply had no idea of what was broken
so that's why I was fishing. Now that I have something working that I
can actually see, I am not so stuck and I can play around a bit. I'll
send you my skype seperatly but it's quite late in .de now..
> ICQ # or whatever and I'll get back to you ASAP. Also, is there an
> easy way for me to download and test your plugin?
Yes, there is.. it's all in CVS:
see:
http://eclipse.org/amp/developers/building.php
http://eclipse.org/amp/developers/repositoryDetails.php
Then see...
http://wiki.eclipse.org/AMP/UserGuide/Escape/Getting_Started
You need to get Escape Exmaples from SVS, not download zip because of
recent changes..
http://ascape.svn.sourceforge.net/svnroot/ascape/org.ascape. escape.models.brook
Then if you import into self-hosted runtime and install above into it,
you should be able to just right-click on
org.ascape.escape.models.brook/src/edu.brook.pd.PD2_5D -- nothing will
happen I think. Then start PD2D, exit it and try the 2_5D version
again and it should work..
>
>> I've made some progress on this -- really by accident, and now I'm not
>> sure that it's an API change issue at all -- or at least not directly.
>> What happened is that I've been trying to debug this launching into a
>> hosted runtime and executing the 3D test. By chance I happened to run a
>> regular model that used regular old GEF2D. *After* I ran that, in the
>> same session, suddenly everything worked fine!? But if I exit the
>> runtime, start back up and run the GEF3D first I again don't see
>> anything, just a blank space. Any ideas...? It seems like something low
>> level though OTOH it's possible I've messed something up on my end that
>> is preventing something in the edit part tree not getting loaded the
>> first time.
>
> This sounds vaguely familiar. Does your code use GMF in any way?
No, I don't use GMF at all -- in fact I try to stay away from any
dependencies on UML, GMF, etc.. as it just brings too much stuff in
that I really don't want or need.
> Btw. regarding your previous message: The entire rendering system has
> been changed and performRender() does no longer get called. Instead,
> your figure has to implement
> Renderable#collectRenderFragments(RenderContext). See also the
> RenderFragment interface. The general idea is this: Instead of
> rendering figures right away, the render context collects render
> fragments from all figures. These fragments can render themselves and
> they have a render type (transparent, superimposed, opaque or ignore).
> This was done to ensure that everything is rendered in the correct
> order (opaque with depth test, transparent with depth test and ordered
> back to front, superimposed without depth test and ordered back to
> front). So during painting the render fragments are collected and store
> in the render context, and when the tree was entirely traversed, they
> are sorted by their type and possibly their distance from the camera
> and finally, they get rendered.
I read the very detailed treatment of the RenderFragment stuff. I'm
still a bit lost on it, but I think it makes sense it outline and I can
see that transparancy is working much better now. What I'm not clear on
is how I actually trigger a render event now. For performance I need to
be able to prevent rendering from occuring while I update the positions
of many many figures, and then update them all at once. I had been
doing that by updating contrainst manually all at once and then
invalidating the tree and calling perform render. But it sounds like
the new design will actually work much better for what I want to try to
do. In fact, I find myself removing a bunch of code, which is always a
good thing. Before you get too involved in checking things through I
shold probably experiment a bit more on my end. It might be something
as simple as an adapter not getting loaded correctly.
cheers,
Miles
|
|
| | | |
Goto Forum:
Current Time: Mon Sep 23 02:11:10 GMT 2024
Powered by FUDForum. Page generated in 0.05609 seconds
|