Looking for Camera 'Quake n Shake' Code
Blitz3D Forums/Blitz3D Programming/Looking for Camera 'Quake n Shake' Code
| ||
Looking for Camera 'Quake n Shake' aka RumbleCam with variable intensity. |
| ||
What does "quake n shake" mean? What is "rumblecam?" Could you perhaps describe what it is you want? |
| ||
this is easy me. positionentity cam,cam\x+rnd(-1,1),cam\y+rnd(-1,1),cam\z+rnd(-1,1) Simple as that. if you want to be able to set the amount of rumble just replace the 1's with a var.] It works really well cos I use it for one of my games. |
| ||
You might use a variable in the rnd parameters that is decreasing in a second or two down to zero, so it looks like the quake is ending slowly. |
| ||
jhocking, Quake n Shake or RumbleCam is the effect of shaking the camera to give emphasis to explosions, impact, and earthquakes. Yavin, jfk Thanks. I'll play with the code and see what I come up with. |
| ||
Function cameraRumble(this.camera,x#,y#,z#) RotateEntity this\entity%,EntityPitch(this\entity%)+Rnd(-x#,x#),EntityYaw(this\entity%)+Rnd(-y#,y#),EntityRoll(this\entity%)+Rnd(-z#,z#) ;adjust & play rumble bass End Function |
| ||
Looking for a deep bass note to complement the rumble cam. |
| ||
RotateEntity this\entity%,EntityPitch(this\entity%)+Rnd(-x#,x#),EntityYaw(this\entity%)+Rnd(-y#,y#),EntityRoll(this\entity%)+Rnd(-z#,z#) You know there is a turnentity() command there for a reason. :-) That said, I don't reccomend you rotate the camera for your shake. Just move it about. Turning it will probably make a lot of players sick, and objects in the distance will move about a lot more than objects up close. Also, in movies, the effect is done my shaking the camera, not by tilting it, and people often expect what they've seen in movies, rather than what might happen in real life. Of course, it's just a suggestion. Rules are made to be broken. :-) |
| ||
What about the 'earthquake effect' thingy in the code archives??? Ive not even tried it myself, but I keep noticing it... |
| ||
sswift, RotateEntity provides the desired effect. Malice, I place the earthquake effect snippet in the archives:) |
| ||
"RotateEntity provides the desired effect." Yes, but if I'm not mistaken, you could replace all of this: RotateEntity this\entity%,EntityPitch(this\entity%)+Rnd(-x#,x#),EntityYaw(this\entity%)+Rnd(-y#,y#),EntityRoll(this\entity%)+Rnd(-z#,z#) With this: TurnEntity this\entity%,Rnd(-x#,x#),Rnd(-y#,y#),Rnd(-z#,z#) |
| ||
sswift, Swap it and works great. thanx |