Author Message

amilmand

00
Posts: 259

Location: ---
Occupation:
Age:
V$:
#139072   2018-03-18 03:43          
No
(the game defines the navigator as a viewport which is rectangular and then tiles the map texture on a very big plane so no not directly)

You can approximate the circle with some (3 in this case) rectangles though of course the error of the approximation induces a wider than "current trends would deem pretty" border.

However this border could be used to show rpm, turbo and other info like in I dont remember which NFS that would make it pretty.

I created 3 navigators ensuring the correct ratios and relative positions (0.7071 is(~) sin(45°) 0.4871 is(~) -sin(22.5°) 0.8733 is(~) -cos(22.5°)) in the track like:
nav =  new Navigator( -23.482, -24.45, 5.828, maps.city.smallmap:0x00000001r,
	maps.city.smallmap:0x00000002r, maps.city.smallmap:0x00000005r, 8, 8, 8 );
nav2 = new Navigator( -23.482, -24.45, 5.828, maps.city.smallmap:0x00000001r,
	maps.city.smallmap:0x00000002r, maps.city.smallmap:0x00000005r, 8, 8, 8  );
nav3 = new Navigator( -23.482, -24.45, 5.828, maps.city.smallmap:0x00000001r,
	maps.city.smallmap:0x00000002r, maps.city.smallmap:0x00000005r, 8, 8, 8  );
float aspectX = 0.09;
float aspectY = 0.16;
float scale = 1.78;
float initialX = 0.44;
float initialY = 2.66;
nav.changeSize(  aspectX*scale*(initialX), aspectY*scale*(initialY),
	aspectX*scale*(0.7071), aspectY*scale*(0.7071) );
nav2.changeSize( aspectX*scale*(initialX+(0.7071-0.4871)/2.0), aspectY*scale*(initialY-(0.8733-0.7071)/2.0),
	aspectX*scale*(0.4871), aspectY*scale*(0.8733) );
nav3.changeSize( aspectX*scale*(initialX-(0.8733-0.7071)/2.0), aspectY*scale*(initialY+(0.7071-0.4871)/2.0),
	aspectX*scale*(0.8733), aspectY*scale*(0.4871) );

The zoom is viewport-height dependent so the animate block also needed updating:
nav.updateNavigator( player.car );
nav2.updateNavigator( player.car );
nav3.updateNavigator( player.car );
nav.cam.setMatrix( new Vector3(CamPos.x/100, GPS_Min_Zoom + Speed, CamPos.z/100),  new Ypr(Rot, -1.57, 0.0) );
nav2.cam.setMatrix( new Vector3(CamPos.x/100, (GPS_Min_Zoom + Speed)*1.236, CamPos.z/100),  new Ypr(Rot, -1.57, 0.0) );
nav3.cam.setMatrix( new Vector3(CamPos.x/100, (GPS_Min_Zoom + Speed)*0.69, CamPos.z/100),  new Ypr(Rot, -1.57, 0.0) );

Thats basically it.
(I also replaced the GPS frame with a circle with the correct size for 16:9)