• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Drawing Lines with the engine
#1
Quote:hi peoples, here is a method to draw a line with the engine.
you will lose some fps on this method.

PHP Code:
float getAngle(DoublePoint selfDoublePoint target)
{
   
float dx target[0] - self[0]; //calculate the distance to the target on the x-axis
   
float dy target[1] - self[1]; //calculate the distance to the target on the y-axis
        
   
float dist sqrt(pow(dx2) + pow(dy2)); //calculate distance to the target by using pythagoras
   
float dangle;      
        
    if (
dy 0dangle = (M_PI 2) - (acos(dx/dist));
    else 
dangle acos(dx/dist); //calculate the angle
           
    
return dangle;        

PHP Code:
void cEngine::DrawLines()
{
    
float xy;
    
float Screen[2];    
        
DoublePoint dpLocal = {Refdef->Width/2Refdef->Height};    
    
    for(
int i=0i<MAX_PLAYERSi++)
    {
        
CEntitypEnt getValidEnt();

        if(
WorldToScreen(pEnt->vOrig, &Screen)
        {            
            
DoublePoint dpTarget = {Screen[0], Screen[1]};
            
float fAngle getAngle(dpLocaldpTarget);
            
            if(!
fAngle)
                continue;        

            
float fDist getDist();        
            
int size fdist/lineDist;            

            for(
int i=0i<sizei++)
            {
                if(
== 0)
                {
                    
= (dpLocal[0] + lineDist cos(fAngle));
                            
= (dpLocal[1] + lineDist sin(fAngle));
                    
CG_DrawPic(xy1010tRedRegisterShader("compassping_enemyfiring"7));                    
                }else
                                 {                
                        
= (lineDist cos(fAngle));
                                
= (lineDist sin(fAngle));
                        
CG_DrawPic(xy1010tRedRegisterShader("compassping_enemyfiring"7));
                                 }
            }    
        }
    }


by editing the linedist you can also make it look like a real line, or you can use other shaders

Credits:
cardoow
[-] The following 1 user says Thank You to d0h! for this post:
  • cardoow
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  TUTORIAL CHEAT ENGINE for mw3 [HARD] Tony. 5 1,740 10-24-2013, 15:22
Last Post: Tomsen1410
  Using Cheat Engine 6.2 to change BO2 address values wzlrsaur 6 4,358 08-06-2013, 06:28
Last Post: 14th
  can't find script engine "VBScript" for script "C:\Windows\system32\slmgr.vbs" ddaavvee 6 16,781 06-18-2013, 03:46
Last Post: dylankrajewski
  [News] Call Of Duty: Ghosts - New Engine Video Tomsen1410 7 2,049 06-10-2013, 20:24
Last Post: Pozzuh
  Using Cheat Engine with Zombies Single Player kikkawa 3 5,686 06-03-2013, 01:18
Last Post: kikkawa
  Why there are no modding for Frostbite Engine RaZ 2 1,435 03-30-2013, 17:14
Last Post: Pozzuh
  [Request] Chat Lines Extended xDarkPrince 3 1,089 09-20-2012, 19:48
Last Post: xDarkPrince
  [News] Black ops 2 zombies in MP engine Pozzuh 28 3,950 09-02-2012, 15:21
Last Post: Nekochan
  Can't play any unreal engine games. Pozzuh 2 1,350 07-09-2012, 19:53
Last Post: Pozzuh
  Preview Unreal Engine 4 development walkthrough Pozzuh 6 1,197 06-11-2012, 23:05
Last Post: JoSchaap

Forum Jump:


Users browsing this thread: 1 Guest(s)