Coordinates of the player's camera first person view
Hello everyone.
Tell me the position where the player's camera is located, first-person view. How to get the coordinates of the player's camera, first-person view. The player's eye position is the player's camera position? GetClientEyePosition(client, pos); |
Re: Coordinates of the player's camera first person view
Yes. Usually locate just behind head of player model (depends player model).
GetClientEyePosition https://sm.alliedmods.net/new-api/sd...entEyePosition You get common problem when use SDKTools TraceRay function, you will hit player model and you need filter that out. GetClientAbsOrigin https://sm.alliedmods.net/new-api/cl...lientAbsOrigin Origin under feet (depends how player model has created) |
Re: Coordinates of the player's camera first person view
1 Attachment(s)
Ok. Thanks.
I create an ENT camera on the coordinates of the player's eye: Code:
int ent_camera = CreateEntityByName("prop_physics_override"); I'm trying to get my 3D camera model to follow the player always at the position of their eyes. Code:
Format(ParentCamera, sizeof(ParentCamera), "%i", client); [url]https://forums.alliedmods.net/attachment.php? |
Re: Coordinates of the player's camera first person view
Does it change if you set higher ?
pos[2] += 64.0; Could parenting do something weird... maybe player model parent attachment is another option. *edit Or did csgo players have own view entity ? |
Re: Coordinates of the player's camera first person view
If you tie a player's skeleton to the bones - this is not good, the bones move - the camera also moves.
|
Re: Coordinates of the player's camera first person view
Quote:
|
Re: Coordinates of the player's camera first person view
There may be an error in the binding code:
PHP Code:
|
Re: Coordinates of the player's camera first person view
I tested between eyes and abs, I got these Z values
Code:
32.310600 If you are teleporting too soon on player while he spawn for example ? |
Re: Coordinates of the player's camera first person view
I'm on my way to work now. I'll come home from work, check it out, and let you know.
|
Re: Coordinates of the player's camera first person view
Try this:
Code:
SetVariantString("!activator"); Then, if the offset needs to be modified, you could use the "m_vecOrigin" vector property to set the attachment offset. By default after using SetParentAttachment is 0 0 0. This is not the same as "m_vecAbsOrigin" and it is also different from TeleportEntity. |
All times are GMT -4. The time now is 04:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.