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.

Dark GDK / Follow the camera.

Author
Message
Xeno360
15
Years of Service
User Offline
Joined: 30th Apr 2009
Location:
Posted: 1st May 2009 04:19
Okie so i think im trying to do this the hard way... is there a tutorial out there that shows how to use a model adn actually be able to make it move and have the camera follow? ive been trying.. to have it move the camera as usual, and then however i move the camera the models moves as well, but he goes right thru terrain etc. idk how to do this =X.
ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 1st May 2009 23:09
What you need to do is set up your system to control the characters movement and his rotation. You than place a 3d sphere at the characters location, rotate it to your characters orientation, and than offset the sphere. Next you place your camera at the spheres location and rotate it towards your player.

You need to use a collision or physics library such Sparky's Collisions, PhysX, Newton Game Dynamics, etc to perform collision checks between your character and the game world. It is a lot harder to do, but using my method you are set up to also perform collision detection with the camera sphere and the game world, allowing you to make sure your camera can't be positioned behind the game world.

You could use rays to test the location where the camera sphere will be moved after it has been rotated, this will allow you to position the camera sphere in front of any obstacles or the game environment.

I have 200 lines of code dedicated to moving my character around the game world, I haven't implemented checking the camera sphere for collision yet. I am also using Sparky's collision and will have to rewrite my character controller when I finally implement PhysX into my code.

------------------------------------
Currently 1300+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.

Login to post a reply

Server time is: 2024-11-25 13:17:08
Your offset time is: 2024-11-25 13:17:08