Camera Zoom in Turret View
-
Great stuff as always adoxa. Is there a way to reverse the scroll? (or invert, if that’s the way you like to roll)
-
wrote:
You have to make from constant a dynamic parameter… If you want dynamic zoom in turret view.[Cockpit] mesh = cockpits\liberty\models\li_freighter_cockpit.cmp int_brightness = 0.500000 head_turn = 30, 120 [CockpitCamera] [TurretCamera] tether = 0.000000, 20, ->230 <---- this constant yaw_rotate_speed = 2.000000 pitch_rotate_speed = 1.500000 accel_speed = 5 [RearViewCamera] view_position = 0.000000, 20.000000, 360.000000
Thanks for the Tips
@Adoxa: thanks for the plug in, on ly in turret view s perfect for my use, cause with the limit 101 technique, arrow keys let me move in turret view for my BIG ships in asteroid fields
later, to make player the availability to choose their own keys, if posible^^Thanks again to both of you for the help
-
Here’s an update that might do what you mean by zoom in, by switching to a negative z coord. Note that zooming in a lot plays havoc with the camera speed. I’ve also maxed it out at 500k.
@Bob: If by reverse/invert you mean swap the meaning of the wheel direction, then patch the DLL at 0x1009, 0x7D->0x7E and 0x107C, 0x7E->0x7D.
-
Thanks adoxa, that works much better.
and a short video…
-
@Bob: If by reverse/invert you mean swap the meaning of the wheel direction, then patch the DLL at 0x1009, 0x7D->0x7E and 0x107C, 0x7E->0x7D.
Unfortunately my experience with dll’s end at changing some simple data type stuff out of Limit Breaking 101.
I’ve got no idea how to do that. -
Use hex editor .
I recommend 010 editor or HexWorkshop .
You have to search in hexadecimal the adress adoxa provided and at that adress is filled with some value that is also hexadecimal .
You only have to change that value at that adress from 7D to 7E and 7E to 7D .
Uploaded with ImageShack.us
Uploaded with ImageShack.us -
http://i267.photobucket.com/albums/ii286/Bobthemanofsteel/turrethex.jpg
I dunno whether I broke it or I’m just missing something fundamental. xD
EDIT: Image wasn’t working for me, so made into a link. :S
-
facepalm
That’s a Bob mistake. >_>Thanks.
-
adoxa wrote:
Here’s an update that might do what you mean by zoom in, by switching to a negative z coord. Note that zooming in a lot plays havoc with the camera speed. I’ve also maxed it out at 500k.@Bob: If by reverse/invert you mean swap the meaning of the wheel direction, then patch the DLL at 0x1009, 0x7D->0x7E and 0x107C, 0x7E->0x7D.
Awesome work Adoxa, thx.
void Zoom( void ) { if (*wheel_state < 0) { if (*TurretCamera < 0) { if (*TurretCamera > -500e6f) *TurretCamera *= 1.5f; } else if (*TurretCamera < 10) { *TurretCamera *= -1; TurretCamera[8] /= 2; // yaw_rotate_speed TurretCamera[9] /= 2; // pitch_rotate_speed } else { *TurretCamera /= 1.5f; } } else if (*wheel_state > 0) { if (*TurretCamera > 0) { if (*TurretCamera < 500e6f) *TurretCamera *= 1.5f; } else if (*TurretCamera > -10) { *TurretCamera *= -1; TurretCamera[8] *= 2; // yaw_rotate_speed TurretCamera[9] *= 2; // pitch_rotate_speed } else { *TurretCamera /= 1.5f; } } }
What do i have to change for changing the max zoom from 500k to 50k and the value of zoom from 1.5 to 1.2 ?
Just wanted that ppl cannot zoom out too far and make zooming more “smooth”.Seems i cannot find the correct hex values in the dll
Thx in advance
cheers
CURSOR -
Thx a lot Adoxa
-
Yes, thanks.
-
Here is a fresh video.
Near the end I zoom in on some npcs. Notice that they reach the extent of their life at 2.5k from me and disappear, heh. But also notice the cool effects of being able to clearly hear their speech and even engine sounds.
The only ‘bug’ I can report is that the program ‘remembers’ the zoom factor. If you have zoomed to 20k and then leave zoom and fly around a bit, when you go back to turret view you are still zoomed at 20k and disoriented until you unzoom back to your ship to catch your bearings.
Is there any way to have it reset to the ship when you leave turret view? Maybe not possible, but still an excellent addition adoxa! -
Here’s another update. When you enter Turret View, it will remember the current values; on exit, they are restored. The speed is halved every -10k, which helps a little.
002028, 200000f = max zoom distance
00202C, 10000f = zoom movement holding Shift
002030, 1000f = zoom movement holding Ctrl
002034, 100f = zoom movement holding Alt
002038, 10f = zoom movement holding Shift+Ctrl
00203C, 1.1f = zoom factor
002040, 0.5d = negative distance speed adjustment PART 1
002050, 0.5f = negative distance speed adjustment PART 2 -
Well, here is the turret zoom code of Freeworlds if you’d like to integrate it (this is called on rendering any frame):
bool bReloadTurretView; float fTurretViewMulti = 1.0; float fTurretViewTargetMulti = 1.0; float fTurretCameraOffset[3] = {0, 0, 0}; void TurretZoom(CAM_DATA* camera_setup, float fInterval) { // special turret cam zoom if(bReloadTurretView) { // load turret offset data fTurretCameraOffset[0] = camera_setup->fCameraOffset[0]; fTurretCameraOffset[1] = camera_setup->fCameraOffset[1]; fTurretCameraOffset[2] = camera_setup->fCameraOffset[2]; // reset multiplier fTurretViewMulti = 1.0; fTurretViewTargetMulti = 1.0; bReloadTurretView = false; } float fMultiDiff = fTurretViewTargetMulti - fTurretViewMulti; fTurretViewMulti += fMultiDiff * fInterval* (float)2.5; camera_setup->fCameraOffset[0] = fTurretCameraOffset[0]*fTurretViewMulti; camera_setup->fCameraOffset[1] = fTurretCameraOffset[1]*fTurretViewMulti; camera_setup->fCameraOffset[2] = fTurretCameraOffset[2]*fTurretViewMulti; }
And in the input hook:
case USER_WHEEL: { // up or down? int* iMWheelFlag; iMWheelFlag = (int*)0x061684C; if(*iMWheelFlag < 0) // up { fTurretViewTargetMulti *= (float)1.1;
and so on