Alessandro10 (12-26-2010),confict (12-27-2010),flameswor10 (12-26-2010),GodHack2 (12-26-2010),J (12-26-2010),Sydney (12-26-2010)
[php][/php]It's a FAN, no a PROPELLER, NO A CROSSHAIR
(yea i am bored)
I was making 3D objects showing off in Jeffrey's face when he said he will put me up for a challenge. I chose to make spinning crosshairs with him as a judge(these are easy :P I WIN)
CREDIT: TOPBLAST,
I dont think there are any others Even like that if it is not Spinning.. I WILL FINE U.. I HAVE A LOT OF TIME AND A LOT OF GOOGLE!!!!!!!!!!!!
[php]// Coded and Created by : TOPBLAST
// Credits At to be Given to : Topblast
// my head is hurting after a little math but it is done. Spinning Crosshair V1
#pragma once
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")
#define D3DX_ToRadian(degree) ((degree) * (D3DX_PI / 180.0f))
struct CUSTOMVER {FLOAT X, Y, Z; DWORD COLOR;};
#define CUSTOMF (D3DFVF_XYZ | D3DFVF_DIFFUSE)
struct SAVE{DWORD color1, color2, color3, color4; bool type;};
class Crosshair
{
public:
Crosshair(LPDIRECT3DDEVICE9 d3ddev, bool type = false,DWORD color1 = 0xffff0000, DWORD color2 = 0xff00ff00, DWORD color3=0xff0000ff, DWORD color4=0x00000000){
SAVE dat = {color1, color2, color3, color4,type};
D3DVIEWPORT9 viewP;
d3ddev->GetViewport( &viewP );
float CEN_WIDTH = viewP.Width/2;
float CEN_HEIGHT = viewP.Height/2 ;
if (type==true ){
CUSTOMVER vertices[] =
{
{ 0.55f, -0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ 0.55f, 0.1f, 0.0f, color1, },
{ 0.0f, 0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
CUSTOMVER vertices2[] =
{
{ -0.1f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ 0.1f, 0.55f, 0.0f, color2, },
{ -0.1f, 0.55f, 0.0f, D3DCOLOR_XRGB(0, 255, 0), },
};
CUSTOMVER vertices3[] =
{
{ 0.1f, -0.55f, 0.0f, color3, },
{ 0.1f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ -0.1f, -0.55f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
CUSTOMVER vertices4[] =
{
{ -0.55f, 0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ -0.55f, -0.1f, 0.0f, color4, },
{ 0.0f, -0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
d3ddev->CreateVertexBuffer(9*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v1_buffer,
NULL);
VOID* pVoid;
v1_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices, sizeof(vertices));
v1_buffer->Unlock();
this->t1_vert = vertices;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v2_buffer,
NULL);
v2_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices2, sizeof(vertices2));
v2_buffer->Unlock();
this->t2_vert = vertices2;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v3_buffer,
NULL);
v3_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices3, sizeof(vertices3));
v3_buffer->Unlock();
this->t3_vert = vertices3;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v4_buffer,
NULL);
v4_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices4, sizeof(vertices4));
v4_buffer->Unlock();
this->t4_vert = vertices4;
}else{
CUSTOMVER vertices[] =
{
{ 0.55f, -0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ 0.55f, 0.1f, 0.0f, color1, },
{ 0.0f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
CUSTOMVER vertices2[] =
{
{ 0.0f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ 0.1f, 0.55f, 0.0f, color2, },
{ -0.1f, 0.55f, 0.0f, D3DCOLOR_XRGB(0, 255, 0), },
};
CUSTOMVER vertices3[] =
{
{ 0.1f, -0.55f, 0.0f, color3, },
{ 0.0f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ -0.1f, -0.55f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
CUSTOMVER vertices4[] =
{
{ -0.55f, 0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ -0.55f, -0.1f, 0.0f, color4, },
{ 0.0f, -0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
d3ddev->CreateVertexBuffer(9*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v1_buffer,
NULL);
VOID* pVoid;
v1_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices, sizeof(vertices));
v1_buffer->Unlock();
this->t1_vert = vertices;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v2_buffer,
NULL);
v2_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices2, sizeof(vertices2));
v2_buffer->Unlock();
this->t2_vert = vertices2;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v3_buffer,
NULL);
v3_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices3, sizeof(vertices3));
v3_buffer->Unlock();
this->t3_vert = vertices3;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v4_buffer,
NULL);
v4_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices4, sizeof(vertices4));
v4_buffer->Unlock();
this->t4_vert = vertices4;
}
d3ddev->SetRenderState(D3DRS_LIGHTING, FALSE);
}
void Reset(LPDIRECT3DDEVICE9 d3ddev){
t1_vert=t2_vert=t3_vert=t4_vert=NULL;
v1_buffer=v2_buffer=v3_buffer=v4_buffer=NULL;
D3DVIEWPORT9 viewP;
d3ddev->GetViewport( &viewP );
float CEN_WIDTH = viewP.Width/2;
float CEN_HEIGHT = viewP.Height/2 ;
if (this->data.type==true ){
CUSTOMVER vertices[] =
{
{ 0.55f, -0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ 0.55f, 0.1f, 0.0f, this->dat*****lor1, },
{ 0.0f, 0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
CUSTOMVER vertices2[] =
{
{ -0.1f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ 0.1f, 0.55f, 0.0f, this->dat*****lor2, },
{ -0.1f, 0.55f, 0.0f, D3DCOLOR_XRGB(0, 255, 0), },
};
CUSTOMVER vertices3[] =
{
{ 0.1f, -0.55f, 0.0f, this->dat*****lor3, },
{ 0.1f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ -0.1f, -0.55f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
CUSTOMVER vertices4[] =
{
{ -0.55f, 0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ -0.55f, -0.1f, 0.0f, this->dat*****lor4, },
{ 0.0f, -0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
d3ddev->CreateVertexBuffer(9*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v1_buffer,
NULL);
VOID* pVoid;
v1_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices, sizeof(vertices));
v1_buffer->Unlock();
this->t1_vert = vertices;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v2_buffer,
NULL);
v2_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices2, sizeof(vertices2));
v2_buffer->Unlock();
this->t2_vert = vertices2;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v3_buffer,
NULL);
v3_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices3, sizeof(vertices3));
v3_buffer->Unlock();
this->t3_vert = vertices3;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v4_buffer,
NULL);
v4_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices4, sizeof(vertices4));
v4_buffer->Unlock();
this->t4_vert = vertices4;
}else{
CUSTOMVER vertices[] =
{
{ 0.55f, -0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ 0.55f, 0.1f, 0.0f, this->dat*****lor1, },
{ 0.0f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
CUSTOMVER vertices2[] =
{
{ 0.0f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ 0.1f, 0.55f, 0.0f, this->dat*****lor2, },
{ -0.1f, 0.55f, 0.0f, D3DCOLOR_XRGB(0, 255, 0), },
};
CUSTOMVER vertices3[] =
{
{ 0.1f, -0.55f, 0.0f, this->dat*****lor3, },
{ 0.0f, 0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ -0.1f, -0.55f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
CUSTOMVER vertices4[] =
{
{ -0.55f, 0.1f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
{ -0.55f, -0.1f, 0.0f, this->dat*****lor4, },
{ 0.0f, -0.0f, 0.0f, D3DCOLOR_XRGB(255, 255, 255), },
};
d3ddev->CreateVertexBuffer(9*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v1_buffer,
NULL);
VOID* pVoid;
v1_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices, sizeof(vertices));
v1_buffer->Unlock();
this->t1_vert = vertices;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v2_buffer,
NULL);
v2_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices2, sizeof(vertices2));
v2_buffer->Unlock();
this->t2_vert = vertices2;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v3_buffer,
NULL);
v3_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices3, sizeof(vertices3));
v3_buffer->Unlock();
this->t3_vert = vertices3;
d3ddev->CreateVertexBuffer(3*sizeof(CUSTOMVER),
0,
CUSTOMF,
D3DPOOL_MANAGED,
&this->v4_buffer,
NULL);
v4_buffer->Lock(0, 0, (void**)&pVoid, 0);
memcpy(pVoid, vertices4, sizeof(vertices4));
v4_buffer->Unlock();
this->t4_vert = vertices4;
}
d3ddev->SetRenderState(D3DRS_LIGHTING, FALSE);
}
~Crosshair(){t1_vert=t2_vert=t3_vert=t4_vert=NULL;
v1_buffer=v2_buffer=v3_buffer=v4_buffer=NULL;}
void Draw(LPDIRECT3DDEVICE9 d3ddev){
D3DVIEWPORT9 viewP;
d3ddev->GetViewport( &viewP );
int SCREEN_WIDTH = viewP.Width;
int SCREEN_HEIGHT = viewP.Height ;
d3ddev->SetFVF(CUSTOMF);
D3DXMATRIX matRotateY;
static float index = 0.0f; index+=0.05f;
D3DXMatrixRotationZ(&matRotateY, index);
d3ddev->SetTransform(D3DTS_WORLD, &matRotateY);
D3DXMATRIX matView;
D3DXMatrixLookAtLH(&matView,
&D3DXVECTOR3 (0.0f, 0.0f, 15.0f),
&D3DXVECTOR3 (0.0f, 0.0f, 0.0f),
&D3DXVECTOR3 (0.0f, 1.0f, 0.0f));
d3ddev->SetTransform(D3DTS_VIEW, &matView);
D3DXMATRIX matProjection;
D3DXMatrixPerspectiveFovLH(&matProjection,
D3DX_ToRadian(45),
(FLOAT)SCREEN_WIDTH / (FLOAT)SCREEN_HEIGHT,
1.0f,
100.0f);
d3ddev->SetTransform(D3DTS_PROJECTION, &matProjection);
d3ddev->SetStreamSource(0, v1_buffer, 0, sizeof(CUSTOMVER));
d3ddev->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
d3ddev->SetStreamSource(0, v2_buffer, 0, sizeof(CUSTOMVER));
d3ddev->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
d3ddev->SetStreamSource(0, v3_buffer, 0, sizeof(CUSTOMVER));
d3ddev->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
d3ddev->SetStreamSource(0, v4_buffer, 0, sizeof(CUSTOMVER));
d3ddev->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);
}
private:
SAVE data;
CUSTOMVER *t1_vert, *t2_vert, *t3_vert, *t4_vert;
LPDIRECT3DVERTEXBUFFER9 v1_buffer, v2_buffer, v3_buffer,v4_buffer;
};[/php]
OK now to use this is very simple.
[php]
Crosshair *cross=NULL;
if(menu != Created){
// DO U MENU STUFF AND ADD BELOW
cross = new Crosshair(pDevice, type(true/false, optional), color1(optional), color2(optional), color3(optional), color4(optional) );
}else{
cross->Draw(pDevice);
}
if ur menu is disappearing use Reset!
[/php]
OR
[php]
Crosshair cX;
if(menu != Created){
// DO U MENU STUFF AND ADD BELOW
cX = new Crosshair(pDevice, type(true/false, optional), color1(optional), color2(optional), color3(optional), color4(optional) );
}else{
cX->Draw(pDevice);
}
if ur menu is disappearing use Reset!
[/php]
Contains Crosshair.h
Menu Base.dll(just so u can test)
Ideas are alway welcome(this does not mean i will go with it but you can try)
Last edited by topblast; 12-26-2010 at 11:39 AM.
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development
Alessandro10 (12-26-2010),confict (12-27-2010),flameswor10 (12-26-2010),GodHack2 (12-26-2010),J (12-26-2010),Sydney (12-26-2010)
This shit is SEXY
No I do not make game hacks anymore, please stop asking.
topblast (12-26-2010)
topblast (12-26-2010)
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development
This shit looks sick...Gj Topblast.
Thanks Cosmos
topblast (12-26-2010)
the bad thing is that MPGH will get closed soon cuz it is dead.
Will you go to IH ?
I think IH Sux.
Thanks Cosmos
topblast (12-26-2010)
Forever... I dont think u can get wifi in a box 6 feet down, r a cable will work that long.. by the time u get 100 in the box if the cable int back ur TECH will be so old... it will worth Quadrillions of money... and ur family will old forget u and u be just a rich dead guy.
I was to always to ask u..what kind of pig is that.... is it laughing r vampire?
Last edited by topblast; 12-26-2010 at 11:45 AM.
I just like programming, that is all.
Current Stuff:
- GPU Programmer (Cuda)
- Client/Server (Cloud Server)
- Mobile App Development
/Approved.