Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / smart camera following, uses Newton physics wrapper to avoid collision with walls

Author
Message
Physics coder
20
Years of Service
User Offline
Joined: 25th May 2004
Location: United States
Posted: 12th Jul 2004 00:41 Edited at: 12th Jul 2004 00:48
You need the latest version of the Newton Physics wrapper and have the dll be in the same folder as you save this source too. no media required. The camera has an object and a body. the object follows the player, the camera is positioned at the object following the player and points at the player.

controls: WASD player movement (player is a box)
if the camera gets stuck, it goes up until it goes above the geometry.



-----------------------------------
To delete the bug, delete the code.
Specs: Sony VAIO Laptop, Windows XP, P4 2.8Ghz, 512MB RAM, ATI Radeon 64MB video memory, DBP Upgrade 5.3.
FXTC
20
Years of Service
User Offline
Joined: 3rd Jul 2004
Location: CzechRepublic
Posted: 30th Jul 2004 08:23
very nice
Juso
22
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 1st Aug 2004 01:30 Edited at: 1st Aug 2004 01:43
Its so nice snippet that I made a mini game!
Here is screen



and exe in a zip (3 meg)

http://www.compopus.fi/towers.zip

(My record is 51 sec)
Physics coder
20
Years of Service
User Offline
Joined: 25th May 2004
Location: United States
Posted: 2nd Aug 2004 08:41
cool although the camera isn't stable when it colides with the ground, it jitters, this might be fixed by using curvevalue or something to smooth the camera a bit. There might be something wrong with the moments of inertia for the towers, it seems like they don't fall over right. Still nice mini-game!

-----------------------------------
To delete the bug, delete the code.
Specs: Sony VAIO Laptop, Windows XP, P4 2.8Ghz, 512MB RAM, ATI Radeon 64MB video memory, DBP Upgrade 5.3.
Mr Underhill
21
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 2nd Aug 2004 10:53
yeah...great mini-game, but Physics Coder is right, the camera is very jittery. My record is 43 seconds, btw !

Keep up the good work!

"You don't need a reason to help people."-Zidane (FFIX)
Jade Phoenix Software is on the way! Get ready for the rebirth of gaming!
Juso
22
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 3rd Aug 2004 02:01
Yeah camera shakes all the time, but it took only 3 hours to change about 20 lines of Physics coder's code to make this mini game.

My record is now 44 secs, so look out Mr Underhill.

Login to post a reply

Server time is: 2024-11-23 19:45:46
Your offset time is: 2024-11-23 19:45:46