Board index » delphi » Animated graphics based on sensor input

Animated graphics based on sensor input


2004-04-19 04:16:18 AM
delphi142
Hi!
We are looking for a solution were we can generate realtime interactive
animated graphics, based on realtime-input from different sensors. The
relevant data from the sensors are ported through a local LAN at different
TCIP adresses. it is mostly GPS-sensors which transmit positions. These
positions are stored in a SQL-base, and the positions form the basis for
parameters like speed, distance, etc.
Our experience with graphics is so far purely based on broadcast solutions.
We are not familiar with realtime animated graphics for a Windows
environment. Are there any concerns we should worry about when it comes to
the ability to update several parameters simultanously without delays in the
graphics? We want to be able to click on an animated graphic element, and
thereby open a new window which shows more in-depth data. Is Delphi a
suitable environment, or are there other solutions which suits us better?
Kind regards
Rune
 
 

Re:Animated graphics based on sensor input

Hi
Delphi is one of the most suitable development tools you can use. For
graphics, it all depends on what you want. You can design a nice user
interface using Delphi forms and controls and then, when user clicks on a
certain control, display detailed information in another window.
If you want more graphics and better look&feel, then you will probably
need a fast graphics engine and a component manager that manages components
(or controls) on the display surface. GDI is very fast if you don't need
things like alpha-blending, antialiasing, fast bitmap stretching,... I'm
curently developing a component manager & graphics system for creating
custom and graphically rich user interfaces, but it is not yet finished. It
would probably be very usefull in your situation as it supports
non-rectangular controls, parent-child relationship and all controls are
interactive.
regards
Tomaz
"Rune Fergestad" <XXXX@XXXXX.COM>writes
Quote
Hi!
We are looking for a solution were we can generate realtime interactive
animated graphics, based on realtime-input from different sensors. The
relevant data from the sensors are ported through a local LAN at different
TCIP adresses. it is mostly GPS-sensors which transmit positions. These
positions are stored in a SQL-base, and the positions form the basis for
parameters like speed, distance, etc.

Our experience with graphics is so far purely based on broadcast
solutions.
We are not familiar with realtime animated graphics for a Windows
environment. Are there any concerns we should worry about when it comes to
the ability to update several parameters simultanously without delays in
the
graphics? We want to be able to click on an animated graphic element, and
thereby open a new window which shows more in-depth data. Is Delphi a
suitable environment, or are there other solutions which suits us better?


Kind regards
Rune


 

Re:Animated graphics based on sensor input

"Rune Fergestad" <XXXX@XXXXX.COM>wrote
Quote
We are looking for a solution were we can generate realtime interactive
animated graphics, based on realtime-input from different sensors. The
relevant data from the sensors are ported through a local LAN at different
TCIP adresses. it is mostly GPS-sensors which transmit positions. These
positions are stored in a SQL-base, and the positions form the basis for
parameters like speed, distance, etc.

Our experience with graphics is so far purely based on broadcast
solutions.
We are not familiar with realtime animated graphics for a Windows
environment. Are there any concerns we should worry about when it comes to
the ability to update several parameters simultanously without delays in
the
graphics? We want to be able to click on an animated graphic element, and
thereby open a new window which shows more in-depth data. Is Delphi a
suitable environment, or are there other solutions which suits us better?
If it is performance you are worried about, even interpreted basic is fast
enough on today's machines to display most realtime animation. it is hard to
decide from your description if you need the utmost speed. That said, Delphi
tends to be less optimized with floating point operations than C/C++, FWIW.
It all depends on what API's (fi GDI, DirectX, OpenGL or GDI+... etc) you
need to work with and what language you prefer and what libraries you plan
on using. I'd give C/C++ the slight edge when it comes to visualization
and graphics simply because there's more stuff out there written in C/C++ in
that domain (Delphi being perceived as a business/database language, whether
rightly or wrongly so) and you don't have to deal with API conversion issues
and sometimes the extra layer.
 

Re:Animated graphics based on sensor input

Hi again.
Thanks for excellent answers! Maybe some more info might be helpful.... To
elaborate on what we are looking for:
Let's say we equip 10 bikes with one GPS-sensor each. These sensors transmit
their positions via the mobile network 5 times a second. These positions are
stored in a SQL-base. We need to show the position of each bike in realtime
on a laptop. This should be done with a map in some bitmap format as the
background. Each bike should have an icon which has a tag/graphic that shows
the name of the biker, along with the realtime values of speed and distance.
These values has to be updated as fast as the data - which is 5 times a
second. This tag/graphic should be linked to the icon of the bike, and track
the poistion on screen automatically. We also want to be able to click for
instance on the speed value on the tag, and thereby open a new, smaller
window (with alpha-channel) which shows a graph of the speed variation over
time.
Regards
Rune
 

Re:Animated graphics based on sensor input

"Rune Fergestad" <XXXX@XXXXX.COM>writes
Quote
Are there any concerns we should worry about when it comes to
the ability to update several parameters simultanously without delays in
the
graphics? We want to be able to click on an animated graphic element, and
thereby open a new window which shows more in-depth data. Is Delphi a
suitable environment, or are there other solutions which suits us better?

All this can be done fairly easily in delphi. Implementation however
depends on what you are trying to display. If the data represents overlay
objects on a map or something like that, then you shouldn't have any
problems at all.
The best method to use is also (in my opinion) determined by the amount of
data that needs to be updated on the display at any one time.
I think you will find the FREE Graphics32 library very handy and it comes with
terrific demos. This library would be most helpful if some kind of
rendering is required as it handles this kind of stuff very quickly.
Sorry, I don't have a link to the library, but I am sure someone else can
help out.
With respect to the opening of a new window, would this window also update
in real-time along with the main window? Also, how many of these
additional windows can be popped up at any one time?
Best Regards
 

Re:Animated graphics based on sensor input

Delphi is the first step. If you want to have graphics you will find that
you need a number of basic shapes that can be clicked and moved about, and
an effective way to define them and alter the properties in code (which then
"automagically" get updated on the screen).
I have some experience with implementing systems like that (for the
automotive industry), and my company sells a Delphi-based component that
could be helpful:
www.simdesign.nl/dtpdocuments.html
Another solution, which could also help you perhaps, can be found here:
www.flex-graphics.com/
Of course I say that our component is more flexible and has more features
(like free rotation) but you can find out for yourself, try the components
and choose the one that offers best price/quality for your problem.
A free graphics library that might help if you want to do the gruntwork
yourself:
www.g32.org
Quote
environment. Are there any concerns we should worry about when it comes to
the ability to update several parameters simultanously without delays in
the
graphics?
Yes.. you must make sure that you use a system where you invalidate parts of
the graphics screen and then use a centralized drawing routine that updates
these parts whenever Windows is ready for it. If you simply draw all
graphics changes directly whenever a parameter changes, you risk to lock the
system up if these changes come at great speed.
Kind regards,
Nils Haeck
www.simdesign.nl
"Rune Fergestad" <XXXX@XXXXX.COM>writes
Quote
Hi!
We are looking for a solution were we can generate realtime interactive
animated graphics, based on realtime-input from different sensors. The
relevant data from the sensors are ported through a local LAN at different
TCIP adresses. it is mostly GPS-sensors which transmit positions. These
positions are stored in a SQL-base, and the positions form the basis for
parameters like speed, distance, etc.

Our experience with graphics is so far purely based on broadcast
solutions.
We are not familiar with realtime animated graphics for a Windows
environment. Are there any concerns we should worry about when it comes to
the ability to update several parameters simultanously without delays in
the
graphics? We want to be able to click on an animated graphic element, and
thereby open a new window which shows more in-depth data. Is Delphi a
suitable environment, or are there other solutions which suits us better?


Kind regards
Rune


 

Re:Animated graphics based on sensor input

You might want to check out archipelago demo at glscene which uses OpenGL
delphi components to create an interactive 3D animated world. The component
library download comes with a bunch of demos. Best results are achieved
using graphic boards with a minimum of 64 MB of memory. See at link:
glscene.sourceforge.net/gallery_demos.htm
-cdw
"Rune Fergestad" <XXXX@XXXXX.COM>writes
Quote
Hi!
We are looking for a solution were we can generate realtime interactive
animated graphics, based on realtime-input from different sensors. The
relevant data from the sensors are ported through a local LAN at different
TCIP adresses. it is mostly GPS-sensors which transmit positions. These
positions are stored in a SQL-base, and the positions form the basis for
parameters like speed, distance, etc.

Our experience with graphics is so far purely based on broadcast
solutions.
We are not familiar with realtime animated graphics for a Windows
environment. Are there any concerns we should worry about when it comes to
the ability to update several parameters simultanously without delays in
the
graphics? We want to be able to click on an animated graphic element, and
thereby open a new window which shows more in-depth data. Is Delphi a
suitable environment, or are there other solutions which suits us better?


Kind regards
Rune


 

Re:Animated graphics based on sensor input

Everyone.
Thanks for great input! I am really getting educated here.
Answer to RandomAccess' Q:
With respect to the opening of a new window, would this window also update
in real-time along with the main window? Also, how many of these
additional windows can be popped up at any one time?
Yes, the plan was to update this window with realtime data as well. I
picture a graph (line or bar) which represents a certain value from the
start till the present time. I don't think it will be necessary with more
than one such window at the time.
Regards
Rune
 

Re:Animated graphics based on sensor input

"Rune Fergestad" <XXXX@XXXXX.COM>writes
Quote

Answer to RandomAccess' Q:
With respect to the opening of a new window, would this window also
update
in real-time along with the main window? Also, how many of these
additional windows can be popped up at any one time?

Yes, the plan was to update this window with realtime data as well. I
picture a graph (line or bar) which represents a certain value from the
start till the present time. I don't think it will be necessary with more
than one such window at the time.

Ok. You haven't mentioned if the additional window will be modal or not,
so let's assume it isn't and you still want the user to interactively work
in the main window while the second window is displayed also.
Such a situation may change things "slightly" (depending on your point of
view).
If you intend the other window to display real-time data simultaneously,
and if you also want to keep the main window's GUI fluid regarding user
input, then you may have to use multi-threading - but to be honest I am not
entirely sure about this at this time.
What I am trying to say is this. If you want to be able to click on an
object and do something interactively with it (ie move it around) and at the
same time update other windows, you may experience "stalls" or jerkiness in
one or more windows.
To keep everything as fluid as possible, ideally you will want to update
different windows in their own thread so they don't interfere with user
interactive performance and screen update timing in your main window.
I've been playing around with some video rendering, with user interactive
overlay. Meaning a video plays and the user can drag objects around the
video while it is playing. Since I use GDI only, and apply various effects,
the performance pretty much sucks once the display size gets too big even
though I always render everything in a single pass.
So, from this experience, I am wondering what the sample rate of the data
is, and therefore what update rate you are expecting for the display and at
what maximum resolution you expect to render the output at.
Also, an alternative solution I thought of is to render everything on the
same display. What you could do is display the additional data (that would
normally appear in a second window) as a translucent overlay over the main
window display, and still allow users to interact with the data that is
"behind" the overlay.
This can be really effective if done properly, because it is easy to turn
the overlay data on and off and it is just as easy for the user to control
the amount of transarency so they get a display output that suits them best.
Best regards
 

Re:Animated graphics based on sensor input

Hi!
Thanks for another excellent answer. I have answered your Q's below....
Regards
Rune
"RandomAccess" <XXXX@XXXXX.COM>writes
Quote

"Rune Fergestad" <XXXX@XXXXX.COM>writes
news:40897d38$XXXX@XXXXX.COM...
>
>Answer to RandomAccess' Q:
>With respect to the opening of a new window, would this window also
update
>in real-time along with the main window? Also, how many of these
>additional windows can be popped up at any one time?
>
>Yes, the plan was to update this window with realtime data as well. I
>picture a graph (line or bar) which represents a certain value from the
>start till the present time. I don't think it will be necessary with
more
>than one such window at the time.
>

Ok. You haven't mentioned if the additional window will be modal or not,
so let's assume it isn't and you still want the user to interactively work
in the main window while the second window is displayed also.
That's correct
Quote

Such a situation may change things "slightly" (depending on your point of
view).
If you intend the other window to display real-time data simultaneously,
and if you also want to keep the main window's GUI fluid regarding user
input, then you may have to use multi-threading - but to be honest I'm
not
entirely sure about this at this time.

What I am trying to say is this. If you want to be able to click on an
object and do something interactively with it (ie move it around) and at
the
same time update other windows, you may experience "stalls" or jerkiness
in
one or more windows.

To keep everything as fluid as possible, ideally you will want to update
different windows in their own thread so they don't interfere with user
interactive performance and screen update timing in your main window.

I've been playing around with some video rendering, with user interactive
overlay. Meaning a video plays and the user can drag objects around the
video while it is playing. Since I use GDI only, and apply various
effects,
the performance pretty much sucks once the display size gets too big even
though I always render everything in a single pass.
This sounds interesting! I am also looking for a solution like that. We often
videotape an event, and we want to syncronize the digitized videostream with
our acquired data. Being able to overlay a graphic of our data on top of the
videostream would be really great....
Quote

So, from this experience, I am wondering what the sample rate of the
data
is, and therefore what update rate you are expecting for the display and
at
what maximum resolution you expect to render the output at.
The sample rate is currently between 5-10 times a second, but we are looking
to increase this to 25-30 in the future. I haven't really thought about the
resolution. I don't think we need to use a very high res.
Quote

Also, an alternative solution I thought of is to render everything on the
same display. What you could do is display the additional data (that
would
normally appear in a second window) as a translucent overlay over the main
window display, and still allow users to interact with the data that is
"behind" the overlay.

This can be really effective if done properly, because it is easy to turn
the overlay data on and off and it is just as easy for the user to control
the amount of transarency so they get a display output that suits them
best.
This sounds like a good idea.
Quote


Best regards




 

Re:Animated graphics based on sensor input

Regarding your video requirements.
There are some Delphi controls (free) that can feed you the frames, but I
have yet to find a free control or library that I found easy to work with.
So I started to look at commercially available controls. The best one I've
found is TVideoGrabber.
www.perfectdownloads.com/software-development/delphi/tvideograbber.htm
The component is expensive ($695) but worth it. These guys made a component
that is extremely easy to use and comes with a good demo. I did not yet buy
it - I am currently playing with the free demo version you can download from
their site. This works great and simply overlays a text message on the
video so you can not use it for real production but you can prototype with it
as all the functionality is there.
I contacted them about the way they provide frame data for saving AVI video
and they say they are already working on providing the necessary
functionality I suggested to them.
Best regards