Camera Zoom in Turret View
-
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