|
-
Feb 27th, 2003, 07:35 PM
#1
Thread Starter
Frenzied Member
3rd person... help :?
I dont want to admit it but i'm stuck 
--
I want to see my character in third person, and I succeeded in playing the camera at the right angle, but I have no clue how interpreter the x,y,z's and how to make things go smooth..
Just to keep things a bit clear for readers:
I've got the following functions available (and can create more if needed but I presume this is all I need)
* Getting/Setting the X,Y,Z of the camera (locational)
* Getting/Setting the X,Y,Z of the player (locational)
* Rotational info for both (and setting it)
code example:
Code:
' init
PlayerModel.Set_Position plX, plY, plZ
PlayerModel.Set_Rotation 0, 1, 0
' this ones in the main render loop
Nemo.Camera_SetPosition Vector(87 + plX, 220 + plY, 114 + plZ), Vector(plX, plY, plZ)
plX = X of player.
plY = Y of player. (which doesn't change, there aren't any height differences on the map)
plZ = Z of the player.
I know the setposition of the camera is wrong, but heck, it worked for now 
so if anyone can help me out with this problem or has some source available that can help me fix or solve this problem...
(I suck at 3d maths btw
-
Feb 27th, 2003, 09:52 PM
#2
Good Ol' Platypus
Look up polar coordinates. They are essential for a 3rd-person camera view.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Feb 27th, 2003, 10:01 PM
#3
Frenzied Member
Well, youve got a rotation for the player, so its fairly simple. Convert the rotation into a direction vector, and normalize it, and multiply it by -1. Then for the position of the camera, its just dir_vec * dist_from _player + player_pos. This will place the camera at a position that is opposite the direction that the player is looking, and behind. You cant hen just set the camera to look at the player model, and you are all set.
Z.
-
Feb 28th, 2003, 02:28 PM
#4
Thread Starter
Frenzied Member
Okay..
but how do I let the playermodel walk to a certain direction.
I can only set the x,y,z... and I keep the 'angle' of the rotation.
If plDirection=90 then x=x+1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|