PDA

View Full Version : View Origin



lilneo
07-02-2011, 07:40 AM
Making an aimbot, and I'm not sure where my slight inaccuracy is coming from. I have a theory though, I am currently using the head bone to define where my view comes from which I am positive is wrong, should I be looking at the abs origin or something else?
~lilneo

b2k5
07-02-2011, 08:51 AM
m_vecOrigin + m_vecEyeOffset

lilneo
07-02-2011, 08:59 AM
m_vecOrigin + m_vecEyeOffset
Is that where the view originates from? Because I did that...

b2k5
07-02-2011, 11:33 AM
i do this:

Vector C_CSBetaPlayer::EyePosition( void )
{
static DWORD dwOffs = NULL;
if( dwOffs == NULL ) {
dwOffs = g_Utils.dwGetNetVarOffset( "DT_BasePlayer>localdata>m_vecViewOffset[0]" );
#ifdef _HACK_DBG
g_Utils.log( "DT_BasePlayer>localdata>m_vecViewOffset[0]: 0x%X", dwOffs );
#endif
}
return this->GetAbsOrigin() + *(Vector*)( (DWORD)this + dwOffs );
}

lilneo
07-02-2011, 05:18 PM
i do this:

Vector C_CSBetaPlayer::EyePosition( void )
{
static DWORD dwOffs = NULL;
if( dwOffs == NULL ) {
dwOffs = g_Utils.dwGetNetVarOffset( "DT_BasePlayer>localdata>m_vecViewOffset[0]" );
#ifdef _HACK_DBG
g_Utils.log( "DT_BasePlayer>localdata>m_vecViewOffset[0]: 0x%X", dwOffs );
#endif
}
return this->GetAbsOrigin() + *(Vector*)( (DWORD)this + dwOffs );
}
I have this


Vector& Esp::GetEyePosition(const C_BaseEntity *pBaseEntity)
{
Vector m_VecOrigin = *(Vector*) ((DWORD) pBaseEntity + 0x2CC);
Vector m_vecViewOffset = *(Vector*) ((DWORD) pBaseEntity + 0x0E4);
return m_VecOrigin + m_vecViewOffset;
}


But that's from a friends source code that he wanted to merge with mine and I'm not sure if that's referring to the actual eye position on the player or the point the players eyes point to?
~lilneo

b2k5
07-03-2011, 05:41 AM
The code is correct. It will give you what u want.
Note: this is not the position of the actual eyes on the model of a player.

lilneo
07-03-2011, 06:00 AM
The code is correct. It will give you what u want.
Note: this is not the position of the actual eyes on the model of a player.
But say I calculate the angle between this point and the point on an enemy bone, then set view angles to that bone it should point exactly to it? Because it seems to be doing some weird shit that isn't right. Then when I change it to my head bone is aims relatively accurate, not perfect though.
lilneo

kolbybrooks
07-03-2011, 11:41 AM
Sounds like you've got some math wrong.

Ghett0
07-03-2011, 12:16 PM
aim at the center of the hitbox or it'll aim at the neck (if you're aiming for the head)



Vector min, max;
matrix3x4_t boneMatrix = GetBoneMatrix(bb->bone, pOtherEntity);
VectorTransform(bb->bbmin, boneMatrix, min);
VectorTransform(bb->bbmax, boneMatrix, max);
pos = (min + max) / 2;


bb is a mstudiobbox_t

Gumble
07-03-2011, 12:41 PM
aim at the center of the hitbox or it'll aim at the neck (if you're aiming for the head)



Vector min, max;
matrix3x4_t boneMatrix = GetBoneMatrix(bb->bone, pOtherEntity);
VectorTransform(bb->bbmin, boneMatrix, min);
VectorTransform(bb->bbmax, boneMatrix, max);
pos = (min + max) / 2;


bb is a mstudiobbox_t

I think he is talking about his own position to calc the delta angle or sth, not rly sure. Also use *0.5, since mul is "faster" than div (not sure if your compiler optimizes that for you)

b2k5
07-03-2011, 01:19 PM
But say I calculate the angle between this point and the point on an enemy bone, then set view angles to that bone it should point exactly to it? Because it seems to be doing some weird shit that isn't right. Then when I change it to my head bone is aims relatively accurate, not perfect though.
lilneo

well you have to account for interpolation yourself.

Madbudds
07-03-2011, 05:16 PM
Awesome work b2k5

lilneo
07-03-2011, 11:56 PM
Sounds like you've got some math wrong.
Maybe you missed the part I said it works fine if I don't use that.


aim at the center of the hitbox or it'll aim at the neck (if you're aiming for the head)



Vector min, max;
matrix3x4_t boneMatrix = GetBoneMatrix(bb->bone, pOtherEntity);
VectorTransform(bb->bbmin, boneMatrix, min);
VectorTransform(bb->bbmax, boneMatrix, max);
pos = (min + max) / 2;

bb is a mstudiobbox_t
I just did z+=3 for the head bone and it worked fine, but thanks, this will be helpful.


I think he is talking about his own position to calc the delta angle or sth, not rly sure. Also use *0.5, since mul is "faster" than div (not sure if your compiler optimizes that for you)
Yeah I'm talking about the exact origin of setviewangles/pCmd->viewangles so that when I am calculating the distances between the enemy and me and I change the angles it will be perfect.


well you have to account for interpolation yourself.
Uh... Explain what you mean a bit. Everything works fine when I use my own head bone, it's just slightly inaccurate and instead of doing some ghettofix to make it aim properly I want to do it the right way. So I am trying to find the point of origin on the player.
For example, say I am calculating my distances from a point that is 30 pixels above where the actual origin is, when I calculate from there then apply it to my real origin it will aim below where I need to since from that point it's below but perhaps in line with the real point. Here is a picture to explain
3974

kolbybrooks
07-04-2011, 11:28 AM
QAngle aimAngles;

VectorAngles( AimPosition - EyePosition, aimAngles );


I don't see the problem... Your math is either wrong, or you're doing something else wrong that would affect the math; There is no other explanation.

lilneo
07-04-2011, 05:44 PM
QAngle aimAngles;

VectorAngles( AimPosition - EyePosition, aimAngles );


I don't see the problem... Your math is either wrong, or you're doing something else wrong that would affect the math; There is no other explanation.
I'm not doing the math wrong, that's the one part of the aimbot that was the easiest for me. I was two years ahead in math through school.
If you can't see the fucking issue then don't post, what I am asking is where the exact origin that viewangles 'originate' from.

I'll dumb down the question more, if you're dealing with a unit grid, the origin of all angles are from 0,0. If you calculate the angle from 0,1 to 1,1. You will get a bit more than pi/4 (45degrees). If you then set that angle to 0,0. the ORIGIN of the angles, then you will no longer be pointing at 1,1 (where you want to point). My question is where is the '0,0' point on the player, and how do I obtain it.

kolbybrooks
07-05-2011, 05:49 PM
I'm not doing the math wrong, that's the one part of the aimbot that was the easiest for me. I was two years ahead in math through school.
If you can't see the fucking issue then don't post, what I am asking is where the exact origin that viewangles 'originate' from.

I'll dumb down the question more, if you're dealing with a unit grid, the origin of all angles are from 0,0. If you calculate the angle from 0,1 to 1,1. You will get a bit more than pi/4 (45degrees). If you then set that angle to 0,0. the ORIGIN of the angles, then you will no longer be pointing at 1,1 (where you want to point). My question is where is the '0,0' point on the player, and how do I obtain it.

Why are you calculating the angles from the origin and then translating them to the eyes ( If that's what you're trying to get out of your rambling, I can't understand wtf-a-nese )? That's your problem. You've been told how to get the absolute eye position. If you still can't figure it out, try showing us the problem instead of rambling in a language no one can understand.

Regardless, I don't see why you're pissed that I'm having 0 problems with 7th grade trig and you are.

lilneo
07-05-2011, 06:24 PM
Why are you calculating the angles from the origin and then translating them to the eyes ( If that's what you're trying to get out of your rambling, I can't understand wtf-a-nese )? That's your problem. You've been told how to get the absolute eye position. If you still can't figure it out, try showing us the problem instead of rambling in a language no one can understand.

Regardless, I don't see why you're pissed that I'm having 0 problems with 7th grade trig and you are.

Holy shit, that is my fucking problem. I don't want to calculate from the origin and translate to the eyes, so how do I find the eye position?
I have no fucking issues with trig at all, it's working fine, I just want my code to be correct instead of a ghetto translation from origin to eyes to compensate.
~lilneo

kolbybrooks
07-05-2011, 07:01 PM
m_vecOrigin + m_vecEyeOffset


i do this:

Vector C_CSBetaPlayer::EyePosition( void )
{
static DWORD dwOffs = NULL;
if( dwOffs == NULL ) {
dwOffs = g_Utils.dwGetNetVarOffset( "DT_BasePlayer>localdata>m_vecViewOffset[0]" );
#ifdef _HACK_DBG
g_Utils.log( "DT_BasePlayer>localdata>m_vecViewOffset[0]: 0x%X", dwOffs );
#endif
}
return this->GetAbsOrigin() + *(Vector*)( (DWORD)this + dwOffs );
}

How many times do you have to be told? What's your problem again?

Ghett0
07-06-2011, 05:41 AM
stop being retarded


Vector GetEyePosition( C_BaseEntity *pBaseEntity )
{
return *reinterpret_cast<GenDT_GlobalPlayer*>(pBaseEntity)->localdata()->vecViewOffset0() + pBaseEntity->GetAbsOrigin();
}

lilneo
07-06-2011, 05:27 PM
stop being retarded


Vector GetEyePosition( C_BaseEntity *pBaseEntity )
{
return *reinterpret_cast<GenDT_GlobalPlayer*>(pBaseEntity)->localdata()->vecViewOffset0() + pBaseEntity->GetAbsOrigin();
}
I can't get the offset dumper working because I'm too n0b.

Ghett0
07-06-2011, 05:33 PM
the vfunc indexes are wrong in it. look at the mac libs and fix them.

of course i doubt you'll do that because you're dense as fuck and fixing it doesn't involve copy paste.
you'll probably just keep making threads about HOW IS OFFFSET FORMED HOW CLIENT GET DASISSEMBLE because you can't find the offsets yourself and aren't willing to learn.

http://mpcforum.com/

this site is probably better for you.

lilneo
07-08-2011, 07:35 PM
the vfunc indexes are wrong in it. look at the mac libs and fix them.

of course i doubt you'll do that because you're dense as fuck and fixing it doesn't involve copy paste.
you'll probably just keep making threads about HOW IS OFFFSET FORMED HOW CLIENT GET DASISSEMBLE because you can't find the offsets yourself and aren't willing to learn.

http://mpcforum.com/

this site is probably better for you.
I can program just fucking fine, my issue is reversing. I don't know assembly at all and up till now I've been shortcutting it because I don't have the effort to learn assembly. I've started learning it though.
And I can find offsets perfectly fine, how many threads have you seen for me asking for offsets? And if I can't get the fucking offset dumper working what do you think I've been doing?

xiNSANE
07-09-2011, 02:11 AM
And if I can't get the fucking offset dumper working what do you think I've been doing?


How can we update?


I can program just fucking fine lol

darkcat
07-09-2011, 02:16 AM
For goodness sakes, you do have a copy of OllyDbg right? Try looking at some asm for a change.. or is it your goal to blow the forums up every time you plan a new feature for "your" "hacks"?

Ghett0
07-09-2011, 03:17 AM
http://www.gamedeception.net/threads/22384-Finding-g_pInput?p=150441&highlight=#post150441
http://www.gamedeception.net/threads/21968-Latest-Offset-for-free?p=150221&highlight=#post150221
http://www.gamedeception.net/threads/19170-Universal-Networked-Var-Dumper-(Source-engine)?p=149851&highlight=#post149851
http://www.gamedeception.net/threads/22232-CreateMove?p=149602&highlight=#post149602
http://www.gamedeception.net/threads/22282-m_hActiveWeapon?p=149576&highlight=#post149576
http://www.gamedeception.net/threads/22232-CreateMove?p=149571&highlight=#post149571

No, you copy+paste big time. You keep saying "MY C++ IS GOOD BUT I'M BAD AT ASSEMBLY I NEED TO LEARN IT GIVE OFFSETS PLS" but it doesn't seem you've improved.

kolbybrooks
07-09-2011, 05:22 AM
Just step away from posting for like a month ( or more ) and read some books on asm, it will do you great good.. Assuming you would put at least as much effort into it as you do posting.

b2k5
07-09-2011, 07:29 AM
while you're at it: work through this please. http://cplusplus.com/doc/tutorial/

CypherPresents
07-13-2011, 04:59 AM
Just step away from posting for like a month ( or more ) and read some books on asm, it will do you great good.. Assuming you would put at least as much effort into it as you do posting.

word.

wav
07-15-2011, 10:58 PM
I'm scratching my scrotum as I read this thread and type.

3,333 posts faggots

kolbybrooks
07-15-2011, 11:54 PM
nice work, elitist man whore.