LUDIX-BoT Forum
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 [Open GL] 2 Line Aimbot

Go down 
AuthorMessage
Shagrath



Posts : 57
Join date : 2009-10-10
Location : Istanbul/Turkey

PostSubject: [Open GL] 2 Line Aimbot   Sat Oct 17, 2009 7:39 am

Here's something I wrote:

Code:
void ObjectToWindowShort(float WindowOut[3])
{
    float mvx[16], px[16];
    int vp[4];

    glGetFloatv(GL_MODELVIEW_MATRIX, mvx);
    glGetFloatv(GL_PROJECTION_MATRIX, px);
    glGetIntegerv(GL_VIEWPORT, vp);

    float x2 = px[0]*mvx[12]+px[4]*mvx[13]+px[8]*mvx[14]+px[12];
    float y2 = px[1]*mvx[12]+px[5]*mvx[13]+px[9]*mvx[14]+px[13];
    float z2 = px[2]*mvx[12]+px[6]*mvx[13]+px[10]*mvx[14]+px[14];
    float w2 = px[3]*mvx[12]+px[7]*mvx[13]+px[11]*mvx[14]+px[15];

    WindowOut[0] = (float) vp[0] + vp[2] * 0.5f * (x2/w2 + 1.0f);
    WindowOut[1] = (float) vp[1] + vp[3] * 0.5f * (y2/w2 + 1.0f);
    WindowOut[2] = (float)                0.5f * (z2/w2 + 1.0f);
    WindowOut[1] = (float) (vp[3] - WindowOut[1]);
}

Example aimbot usage:
Code:
// glBindTexture or glDrawElements hook
if(HeadModel)
{
      ObjectToWindowShort(Window);
      SetCursorPos((int)Window[0], (int)Window[1]);
}

Thats literally all, your mouse will now move to their head..

This function is quite a bit faster than gluProject too, because it assumes a camera 0,0,0 position and 0 for w1 therefore it doesn't need half the calculations on the matrices. Furthermore it doesn't need to be clipped or clip checked since any model in the view has already gone through that process.

Thanks to Sinner
Back to top Go down
View user profile
SUXXX
Admin
Admin


Posts : 66
Join date : 2009-10-10

PostSubject: Re: [Open GL] 2 Line Aimbot   Mon Oct 19, 2009 9:43 am

thanks bro!
Back to top Go down
View user profile http://ludix-bot.tk
pepucs



Posts : 5
Join date : 2010-01-01

PostSubject: Re: [Open GL] 2 Line Aimbot   Fri Jan 01, 2010 11:44 am

TY
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: [Open GL] 2 Line Aimbot   

Back to top Go down
 
[Open GL] 2 Line Aimbot
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
LUDIX-BoT Forum :: Coding :: General Coding-
Jump to: