Log in

Please declare the exact username and password!

Forgot password?

Đăng Ký

Bạn phải điền đầy đủ thông tin đăng ký!

  

    3d camera mượt mà bắt chước gamethuvn.net trên main 1.02c

      Administrators
      ๖ۣۜAdministrators

      Posts Posts : 650

      Points Points : 63340

      Thanks Thanks : 744

      Gender Gender : Male

      JoinDate JoinDate : 2010-11-25

      #1

       Sat Mar 05, 2016 3:53 pm

      đây là dll và main 1.02 đã tích hợp sẵn mời anh em giải né vào clien 1.02c để kiểm tra hén
      [You must be registered and logged in to see this link.]
      còn đây là những gì mình đã làm 3d camera mượt mà bắt chước gamethuvn.net trên main 1.02c 4 cái này không giành cho newbie 3d camera mượt mà bắt chước gamethuvn.net trên main 1.02c 1


      Code:
      //Mouse
      BOOL MouseSetHook(BOOL set_or_remove)
      {
          if(set_or_remove == TRUE)
              {
                      if(MouseHook == NULL)
                      {
                              MouseHook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC)MouseProc, hInstance, GetCurrentThreadId());
                              if(!MouseHook){ return FALSE; }
                      }
              } else { return UnhookWindowsHookEx(MouseHook); }
          return TRUE;
      }

      //premo Fine e resetto la visuale
      LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
      {       

              if(((lParam>>31)&1) && (nCode == HC_ACTION))
              {
                      

              if(wParam == VK_F5)
                      {        
                           useHpBar=!useHpBar;
                           char* positive ="Turn On   HP Bar!";
                           char* negative ="Turn Off  HP Bar!";
                           char *stringshow=NULL;
                           DWORD style=2;
                           DWORD opstyle=0;
                           if(useHpBar)
                           {
                               stringshow=positive;
                               //SetJmp((LPVOID)0x069E546,(LPVOID)showBar);
                           }
                           else
                               stringshow=negative;
                           MuShowMessage(stringshow,&opstyle,style);    
                      }
                      
                       if(wParam == VK_F9)
                      {        
                          InitCamera = true;
                          UseCamera=!UseCamera;
                           char* positive ="Turn On  Camera!";
                           char* negative ="Turn Off Camera!";
                           char *stringshow=NULL;
                           DWORD style=2;
                           DWORD opstyle=0;
                           if(UseCamera)
                           {
                               stringshow=positive;
                               CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)RenderThread,NULL,NULL,NULL);
                           }
                           else
                               stringshow=negative;
                           MuShowMessage(stringshow,&opstyle,style);    
                      }
                       if(wParam == VK_F10)
                      {
                              if( UseCamera)
                              {
                                       scrollAccelator=1;
                                       char* positive ="Default Camera!";
                                       char *stringshow=NULL;
                                       DWORD style=2;
                                       DWORD opstyle=0;
                                       stringshow=positive;
                                       MuShowMessage(stringshow,&opstyle,style);            
                                      *Camera_RotY = -48.5;
                                      *Camera_RotZ = -45;
                                      *Camera_PosZ = 150;
                                      *Camera_ClipX = 1190;
                                      *Camera_ClipY = 2400;
                                      *Camera_GlClip = 3000;
                                      *Camera_Zoom = 35;
                              }
                      }
                      if(wParam == VK_F11)
                      {
                      ShowWindow(MuWnd,SW_SHOWMINIMIZED);        
                      }

              }        
              return CallNextHookEx(KeyboardHook, nCode, wParam, lParam);
      }

      LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam)
      {
              if (!MuWnd)
              {
              MuWnd = FindWindow(_MU_TILE_, NULL);
              CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)RenderThread,NULL,NULL,NULL);
              }
              if(UseCamera)
              {
              if(GetForegroundWindow() == MuWnd)
                   {
                      MOUSEHOOKSTRUCTEX* mhstemp = (MOUSEHOOKSTRUCTEX*)lParam;
                      switch(wParam){
                          case WM_MBUTTONDOWN:
                              //printf("WM_MBUTTONDOWN\n");
                              MouseX = mhstemp->pt.x;
                              MouseY = mhstemp->pt.y;
                              MoveCamera = true;
                              break;
                          case WM_MBUTTONUP:
                                //printf("WM_MBUTTONUP\n");
                              //moveAccelator=0.0;
                              MoveCamera = false;
                              break;
                          case WM_MOUSEWHEEL:
                              //printf("WM_MOUSEWHEEL\n");
                              scrollAccelator=1;
                              mhsi = *(MOUSEHOOKSTRUCTEX*)lParam;
                              break;
                          case WM_MOUSEMOVE:
                               //printf("WM_MOUSEMOVE\n");
                              if(MoveCamera)
                              {
                                  moveAccelator=1;
                                  mhsi = *(MOUSEHOOKSTRUCTEX*)lParam;
                                  
                              }
                              break;
                      }
                  }
              }
          return CallNextHookEx(MouseHook, code, wParam, lParam);
      }
      void RenderThread(){
          while(UseCamera){
                     usemhsi=mhsi;
                     mhs    =&usemhsi;
                      if(GetForegroundWindow() == MuWnd)
                       {
                          /*if(InitCamera)
                           {
                              printf("First get figure\n");
                              Camera.ClipX  = *Camera_ClipX;
                              Camera.ClipY  = *Camera_ClipY;
                              Camera.GlClip = *Camera_GlClip;
                              Camera.PosZ   = *Camera_PosZ;
                              Camera.RotY   = *Camera_RotY;
                              Camera.RotZ   = *Camera_RotZ;
                              Camera.Zoom   = *Camera_Zoom;
                              InitCamera=false;
                            }*/       
                          if(moveAccelator>0)
                          {
                                  //printf("moveAccelator>0\n");
                                  if(MoveCamera)
                                  {
                                  //printf("MoveCamera\n");
                                  while(moveAccelator>0){
                                          if(MouseX < mhs->pt.x)
                                          {
                                                  //printf("MouseX < mhs->pt.x\n");
                                                  *Camera_RotZ += (float)(8*moveAccelator);
                                                  if (*Camera_RotZ > 315) *Camera_RotZ = (float)(-45);
                                          }
                                          else if(MouseX > mhs->pt.x)
                                          {
                                                  // printf("MouseX > mhs->pt.x\n");
                                                  *Camera_RotZ -= (float)(8*moveAccelator);
                                                  if (*Camera_RotZ < -405) *Camera_RotZ = (float)(-45);
                                          }
                                          if(MouseY < mhs->pt.y)
                                          {
                                                  if(*Camera_RotY < -45)
                                                  {       
                                                         // printf("MouseX > mhs->pt.x\n");
                                                          *Camera_PosZ -= (float)(44*moveAccelator);
                                                          *Camera_RotY += (float)(2.42*moveAccelator);
                                                  }
                                          }
                                          else if(MouseY > mhs->pt.y)
                                          {
                                                  if(*Camera_RotY > -90)
                                                  {
                                                         // printf("MouseX > mhs->pt.x\n");
                                                          *Camera_PosZ += (float)(44*(moveAccelator));
                                                          *Camera_RotY -= (float)(2.42*moveAccelator);
                                                  }
                                          }
                                          *Camera_ClipX  = 1190 + (abs(*Camera_PosZ - 150) * 3) + 6000;
                                          *Camera_ClipY  = 2400 + (abs(*Camera_PosZ - 150) * 3) + 4000;
                                          *Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
                                          if(moveAccelator>0){
                                              moveAccelator-=0.1;
                                          }
                                          Sleep(50);
                                      }//endwhile
                                          MouseX = mhs->pt.x;
                                          MouseY = mhs->pt.y;
                                          
                                  }
                                  
                                  moveAccelator=0.0;
                          }
                          else if(scrollAccelator>0)
                          {
                              //printf("scrollAccelator>0\n");
                              int direction = mhs->mouseData;
                              while(scrollAccelator>0){        
                                  if(direction < 0){
                                      //printf("direction < 0\n");
                                      if(*Camera_Zoom < 60){*Camera_Zoom =*Camera_Zoom+ (float)(2*scrollAccelator);}
                                  }
                                  else if(direction > 0)
                                  {
                                      //printf("direction > 0\n");
                                      if(*Camera_Zoom > 12){*Camera_Zoom =*Camera_Zoom- (float)(2*scrollAccelator);}
                                  }
                                  *Camera_ClipX  = 1190 + (abs(*Camera_PosZ - 150) * 3) + 6000;
                                  *Camera_ClipY  = 2400 + (abs(*Camera_PosZ - 150) * 3) + 4000;
                                  *Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
                                  if(scrollAccelator>0){
                                          scrollAccelator-=0.1;
                                  }
                                  Sleep(50);
                              }
                          }
                      }
              Sleep(50);
          }//end while
          ExitThread(TRUE);
      }



      thuộc quyền sở hữu:
      webzen (tạo ra game cùi bắp nhất 3d camera mượt mà bắt chước gamethuvn.net trên main 1.02c 4)
      Van_bom (share main ngon 3d camera mượt mà bắt chước gamethuvn.net trên main 1.02c 21)
      Domino9990 (hiệu ứng smooth trong renderthread)
      Một đống pro mu khác nữa 3d camera mượt mà bắt chước gamethuvn.net trên main 1.02c 4



      b-) :d  :-l [You must be registered and logged in to see this link.] :-r :d  b-)

      Chú ý
      Like and Reply show Link