|
From: Rick M. <ri...@sw...> - 2003-04-08 04:47:40
Attachments:
sonar1.bmp
sonar2.bmp
|
Posted latest changes to OpenGL code on web site. This week I'm adding
all the old classes to the new code. Hopefully, I have everything back
in its proper place.
Mike, I'm having trouble getting the timer1 function to call
ShipHandeling() and UpdateSensors(). It will work if I just add those
two subroutines to the main loop. The main loop code is as follows:
if (timer1 + (1000 / timecompression) < SDL_GetTicks())
{
timer1 = SDL_GetTicks();
ShipHandeling();
UpdateSensors();
// Testing
cout << Subs[0].BearingToTarget(Subs[1]) << endl;
}
The bearing to the first target seems to be updating, but when you get
time take a look and see what I'm missing.
Also, I've been thinking about the sonar display and think that if we
call a routine similar to the DisplayWidgets() routine in maim.cpp, we
will able to "paste" trace bmps, at an (x,y) on the sonarscreen.bmp that
corresponds to the correct bearing. I've attached a couple of sonar
trace bmp's for the sonar that I think will work. The other bmp that we
will need is a background or noise bmp. I think that if we paste the
trace and noise bmp together with some blending, it might look right.
Rick
|
|
From: Joe V. <jo...@ve...> - 2003-04-08 05:06:56
|
> I think that if we paste the > trace and noise bmp together with some blending, it might look right. How did the old code do it? I'm curious why you don't just use the old code and render the SDL surface to the texture every frame or so. Joe Venzon |
|
From: Michael B. <mic...@ve...> - 2003-04-09 05:16:40
|
On Mon, 2003-04-07 at 22:06, Joe Venzon wrote: > > I think that if we paste the > > trace and noise bmp together with some blending, it might look right. =20 > How did the old code do it? I'm curious why you don't just use the old c= ode and render the SDL surface to the texture every frame or so. >=20 > Joe Venzon >=20 Basically it currently works like this. Setup three different SDL surfaces, two of these are the waterfall displays, the third is a scratch surface used for copies. Step one. Start by plotting 360 (minus the baffle area) background noise pixels. this is done six times (3 timescales * 2 displays). Step two. Every 1/5th second plot one pixel per contact on each timescale on each display applicable display with a slight random variance to get a nice swath for the trace. Step three. Every second blit into the scratch surface the contents of the 0-60 second history window, minus the last line. Turn around and blit it back to the display surface one line lower, and erase the first line and fill it backup with background noise. Every 30 seconds do the same for the 0-30 minute display. Every 2 minutes do the same for the 0-2 hour display. Duplicate Step three for the second sonar window. Divide the times above by what ever timescale we are at. All this happens even when you are not "in" the sonar station via a thread. When you are at the sonar station add blitting the sonar screens too the station. |
|
From: MCDANIEL R. D <MC...@hs...> - 2003-04-08 22:47:32
Attachments:
sonar1.bmp
sonar2.bmp
|
Posted latest changes to OpenGL code on web site. This week I'm adding
all the old classes to the new code. Hopefully, I have everything back
in its proper place.
Mike, I'm having trouble getting the timer1 function to call
ShipHandeling() and UpdateSensors(). It will work if I just add those
two subroutines to the main loop. The main loop code is as follows:
if (timer1 + (1000 / timecompression) < SDL_GetTicks())
{
timer1 = SDL_GetTicks();
ShipHandeling();
UpdateSensors();
// Testing
cout << Subs[0].BearingToTarget(Subs[1]) << endl;
}
The bearing to the first target seems to be updating, but when you get
time take a look and see what I'm missing.
Also, I've been thinking about the sonar display and think that if we
call a routine similar to the DisplayWidgets() routine in maim.cpp, we
will able to "paste" trace bmps, at an (x,y) on the sonarscreen.bmp that
corresponds to the correct bearing. I've attached a couple of sonar
trace bmp's for the sonar that I think will work. The other bmp that we
will need is a background or noise bmp. I think that if we paste the
trace and noise bmp together with some blending, it might look right.
Rick
|
|
From: Michael B. <mic...@ve...> - 2003-04-09 05:40:04
|
I believe the only thing you left out was to initialize the timer sub
system in SDL. So in the main.cpp code you would replace the SDL_Init
call =20
if ( SDL_Init( SDL_INIT_VIDEO ) < 0 )
with
if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0 )
and the timers should work....
I think ;-)
On Tue, 2003-04-08 at 15:32, MCDANIEL RICKEY D wrote:
> Posted latest changes to OpenGL code on web site. This week I'm adding
> all the old classes to the new code. Hopefully, I have everything back
> in its proper place. =20
>=20
> Mike, I'm having trouble getting the timer1 function to call
> ShipHandeling() and UpdateSensors(). It will work if I just add those
> two subroutines to the main loop. The main loop code is as follows:
>=20
> if (timer1 + (1000 / timecompression) < SDL_GetTicks())
> {
> timer1 =3D SDL_GetTicks();
> ShipHandeling();
> UpdateSensors();
> // Testing
> cout << Subs[0].BearingToTarget(Subs[1]) << endl; =20
> } =20
>=20
> The bearing to the first target seems to be updating, but when you get
> time take a look and see what I'm missing.
>=20
> Also, I've been thinking about the sonar display and think that if we
> call a routine similar to the DisplayWidgets() routine in maim.cpp, we
> will able to "paste" trace bmps, at an (x,y) on the sonarscreen.bmp that
> corresponds to the correct bearing. I've attached a couple of sonar
> trace bmp's for the sonar that I think will work. The other bmp that we
> will need is a background or noise bmp. I think that if we paste the
> trace and noise bmp together with some blending, it might look right. =20
>=20
> Rick
>=20
|