gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
302 stars 99 forks source link

"follow" with java2D and opengl #868

Closed pcaillou closed 2 years ago

pcaillou commented 9 years ago
What steps will reproduce the problem?
1. Open a model with an agent moving (for instance Goto Action, Weighted Network)
2. Load it,
3. focus on the agent
5. In java2D, it is not possible to follow the agent

Add type: opengl to the display.
2. Load the model,
3. focus on the agent
4. follow the agent
5. the camera does not seem to follow the agent at all

Please use labels and text to provide additional information.
I am using jogl and not jogl2

Original issue reported on code.google.com by patrick.taillandier on 2014-03-16 09:09:58

pcaillou commented 9 years ago
I think it has never been implemented in GAMA

And indeed there is a problem in opengl in DisplayedAgentMenu.java in widgetSelected()

I don't know how come but when calling surface.followAgent(a); a is null so it raises
an exception and make the follow feature fails...

Original issue reported on code.google.com by agrignard on 2014-03-18 08:29:57

pcaillou commented 9 years ago
Sorry I wanted to say "I think it has never been implemented in Java2D"

Original issue reported on code.google.com by agrignard on 2014-03-18 08:32:25

pcaillou commented 9 years ago
I've change the method to avoid the exception but it just focus on the agent once but
do not follow it...

commit 8924

Original issue reported on code.google.com by agrignard on 2014-03-18 09:01:40

pcaillou commented 9 years ago
As far as I remember, "follow" has never worked in Java2D, and I don't remember seeing
it work in OpenGL (or is it the "first person" view ?).

Original issue reported on code.google.com by alexis.drogoul on 2014-03-18 09:10:42

pcaillou commented 9 years ago
I am not sure to have implemented also..

the first(person cam is working by using camera_pos in the display but not using follow
item.

the problem to make work follow it means that it has to be called every timestep (it's
just a kind of focus on but that is called every iteration)

Original issue reported on code.google.com by agrignard on 2014-03-18 09:26:41

pcaillou commented 9 years ago
If it is not working in Java2D/openGl, the best solution is maybe, for GAMA 1.6.1 to
remove the option for Opengl display and to implement it for GAMA 1.7 (as it can be
a very interesting feature).

Original issue reported on code.google.com by patrick.taillandier on 2014-03-18 09:42:50

pcaillou commented 9 years ago
Ok so I remove it from the menu. Everything is here in opengl to set the camera position
on top of the agent I just don't know how to do call this method at each timestep...

Original issue reported on code.google.com by agrignard on 2014-03-18 10:37:11

pcaillou commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by patrick.taillandier on 2014-03-18 10:37:55

pcaillou commented 9 years ago
remove in revision 8926

I change it form defect to enhancement

Original issue reported on code.google.com by agrignard on 2014-03-18 10:46:24

pcaillou commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by gama.platform on 2014-04-06 09:50:04

pcaillou commented 9 years ago
See Issue 1226: the camera position can now be updated at every iteration of the display
in OpenGL, which makes it possible to implement follow without too many difficulties…
Please note, however, that the classes making up the display framework, i.e. IDisplayOutput,
IDisplaySurface and IGraphics have changed a lot (at least their implementations: for
instance, they now share a common object DisplayOutputData, which contains all the
parameters they have in common, etc. The agent followed, if it can be specified in
the model *and* changed by the user in the UI, has to be added to that class). 

Original issue reported on code.google.com by alexis.drogoul on 2015-05-24 17:09:40

pcaillou commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by agrignard on 2015-05-26 18:36:46

pcaillou commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by agrignard on 2015-05-26 18:47:35

AlexisDrogoul commented 8 years ago

Two things to do here:

agrignard commented 6 years ago

Any update on this one?

I realive this very old issue but I think this feature would be great: Following an agent during the simulation

AlexisDrogoul commented 2 years ago

Can be done in OpenGL using the camera_xxx facets on the display, but maybe worth to reopening it to provide a simpler way to do it ? Reopening this issue for the next round of development on GAMA 2.0, at least for Java2D

AlexisDrogoul commented 2 years ago

It is actually doable now very easily using something like :

camera default target: my_agent dynamic: true;

You can of course play with the other facets, like location(from where does the camera look at the agent ?), or distance...

stale[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

AlexisDrogoul commented 2 years ago

Please note that it has been decided not to port this functionality to Java2D. I therefore close this issue as it is implemented for OpenGL