Perfect 3D Bounding Box

Posts 1630 of 32 · Page 2 of 3
Quote Originally Posted by alisonbbzz View Post
@Goocolax post TWT no DC/Ban
what are you talking about? please speak clearly lol

- - - Updated - - -

Quote Originally Posted by luizimloko View Post
Based on this article:
PT-BR ( https://pt.wikipedia.org/wiki/Caixa_...ra_m%C3%ADnima ).
EN-US ( https://en.wikipedia.org/wiki/Bounding_volume ).



Dynamic 3D Boxes based on player AABB.

Code:
template<class it, class actor>
void CESPFunctions<it, actor>::AABB3D( void ) const
{
	D3DXVECTOR3 vec[ 8 ] { D3DXVECTOR3( 0, 0, 0 ) };

	D3DXVECTOR3 max = this->getEntityIterator( )->getLTObject( )->BoxMax;
	D3DXVECTOR3 min = this->getEntityIterator( )->getLTObject( )->BoxMin;

	if( pEngine->worldToScreen( min, &vec[ 0 ] ) &&
	    pEngine->worldToScreen( max, &vec[ 1 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( max.x, min.y, min.z ), &vec[ 2 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( min.x, max.y, min.z ), &vec[ 3 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( min.x, min.y, max.z ), &vec[ 4 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( min.x, max.y, max.z ), &vec[ 5 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( max.x, min.y, max.z ), &vec[ 6 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( max.x, max.y, min.z ), &vec[ 7 ] ) )
	{
		pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 4 ].x, vec[ 4 ].y, Color( dwColor ) );
		pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 7 ].x, vec[ 7 ].y, Color( dwColor ) );
		pRender->Line( vec[ 2 ].x, vec[ 2 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
		pRender->Line( vec[ 3 ].x, vec[ 3 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );

		pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 2 ].x, vec[ 2 ].y, Color( dwColor ) );
		pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 3 ].x, vec[ 3 ].y, Color( dwColor ) );
		pRender->Line( vec[ 7 ].x, vec[ 7 ].y, vec[ 2 ].x, vec[ 2 ].y, Color( dwColor ) );
		pRender->Line( vec[ 7 ].x, vec[ 7 ].y, vec[ 3 ].x, vec[ 3 ].y, Color( dwColor ) );

		pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );
		pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
		pRender->Line( vec[ 4 ].x, vec[ 4 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );
		pRender->Line( vec[ 4 ].x, vec[ 4 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
	}
}
this requires a lot more supporting code, though
more work for little gain
Quote Originally Posted by alisonbbzz View Post
sorry, is WTW have souce code? @Goocolax
sorry, I don't have it anymore, I removed it from my project
you can search on MPGH though, many methods for it have been released
Quote Originally Posted by Goocolax View Post
sorry, I don't have it anymore, I removed it from my project
you can search on MPGH though, many methods for it have been released
he's just lazy to do another method...
Quote Originally Posted by vaisefud3 View Post
he's just lazy to do another method...
I doubt the methods he's using is patched anyways, most likely the code is sigged. Too many people pasting it.
A few junk instructions will do the trick
Quote Originally Posted by Goocolax View Post
I doubt the methods he's using is patched anyways, most likely the code is sigged. Too many people pasting it.
A few junk instructions will do the trick
He doesn't know how to junk it
Code:
void CVisuals::Box3D(LPDIRECT3DDEVICE9 pDevice, D3DCOLOR ESP_Color, LTObject* obj)
{
	D3DXVECTOR3 _min = obj->GetBoxMin();
	D3DXVECTOR3 _max = obj->GetBoxMax();

	D3DXVECTOR3 crnr2 = D3DXVECTOR3(_max.x, _min.y, _min.z);
	D3DXVECTOR3 crnr3 = D3DXVECTOR3(_max.x, _min.y, _max.z);
	D3DXVECTOR3 crnr4 = D3DXVECTOR3(_min.x, _min.y, _max.z);
	D3DXVECTOR3 crnr5 = D3DXVECTOR3(_min.x, _max.y, _max.z);
	D3DXVECTOR3 crnr6 = D3DXVECTOR3(_min.x, _max.y, _min.z);
	D3DXVECTOR3 crnr7 = D3DXVECTOR3(_max.x, _max.y, _min.z);

	if (D::WTS(_min, &_min) &&
		D::WTS(_max, &_max) &&
		D::WTS(crnr2, &crnr2) &&
		D::WTS(crnr3, &crnr3) &&
		D::WTS(crnr4, &crnr4) &&
		D::WTS(crnr5, &crnr5) &&
		D::WTS(crnr6, &crnr6) &&
		D::WTS(crnr7, &crnr7))
	{
		D::DrawLine(_min.x, _min.y, crnr2.x, crnr2.y, 1, ESP_Color, pDevice);
		D::DrawLine(_min.x, _min.y, crnr4.x, crnr4.y, 1, ESP_Color, pDevice);
		D::DrawLine(_min.x, _min.y, crnr6.x, crnr6.y, 1, ESP_Color, pDevice);
		D::DrawLine(_max.x, _max.y, crnr5.x, crnr5.y, 1, ESP_Color, pDevice);
		D::DrawLine(_max.x, _max.y, crnr7.x, crnr7.y, 1, ESP_Color, pDevice);
		D::DrawLine(_max.x, _max.y, crnr3.x, crnr3.y, 1, ESP_Color, pDevice);
		D::DrawLine(crnr2.x, crnr2.y, crnr7.x, crnr7.y, 1, ESP_Color, pDevice);
		D::DrawLine(crnr2.x, crnr2.y, crnr3.x, crnr3.y, 1, ESP_Color, pDevice);
		D::DrawLine(crnr4.x, crnr4.y, crnr5.x, crnr5.y, 1, ESP_Color, pDevice);
		D::DrawLine(crnr4.x, crnr4.y, crnr3.x, crnr3.y, 1, ESP_Color, pDevice);
		D::DrawLine(crnr6.x, crnr6.y, crnr5.x, crnr5.y, 1, ESP_Color, pDevice);
		D::DrawLine(crnr6.x, crnr6.y, crnr7.x, crnr7.y, 1, ESP_Color, pDevice);
	}
}
void CVisuals::Box2D(LPDIRECT3DDEVICE9 pDevice, D3DCOLOR ESP_Color, LTObject* obj)
{
        D3DXVECTOR3 min = obj->GetBoxMin();
	D3DXVECTOR3 max = obj->GetBoxMax();

	D3DXVECTOR3 points[] =
	{
		D3DXVECTOR3(min.x, min.y, min.z),
		D3DXVECTOR3(min.x, max.y, min.z),
		D3DXVECTOR3(max.x, max.y, min.z),
		D3DXVECTOR3(max.x, min.y, min.z),
		D3DXVECTOR3(max.x, max.y, max.z),
		D3DXVECTOR3(min.x, max.y, max.z),
		D3DXVECTOR3(min.x, min.y, max.z),
		D3DXVECTOR3(max.x, min.y, max.z)
	};

	D3DXVECTOR3 flb;
	D3DXVECTOR3 brt;
	D3DXVECTOR3 blb;
	D3DXVECTOR3 frt;
	D3DXVECTOR3 frb;
	D3DXVECTOR3 brb;
	D3DXVECTOR3 blt;
	D3DXVECTOR3 flt;

	if (D::WTS(points[3], &flb) && D::WTS(points[5], &brt) &&
		D::WTS(points[0], &blb) && D::WTS(points[4], &frt) &&
		D::WTS(points[2], &frb) && D::WTS(points[1], &brb) &&
		D::WTS(points[6], &blt) && D::WTS(points[7], &flt))
	{
		D3DXVECTOR3 arr[] = { flb, brt, blb, frt, frb, brb, blt, flt };

		float left = flb.x;		// left
		float top = flb.y;		// top
		float right = flb.x;	// right
		float bottom = flb.y;	// bottom

		for (int i = 1; i < 8; i++)
		{
			if (left > arr[i].x)
				left = arr[i].x;
			if (top < arr[i].y)
				top = arr[i].y;
			if (right < arr[i].x)
				right = arr[i].x;
			if (bottom > arr[i].y)
				bottom = arr[i].y;
		}

		D::DrawLine(left, bottom, left, top, 1, ESP_Color, I::pDevice);
		D::DrawLine(left, top, right, top, 1, ESP_Color, I::pDevice);
		D::DrawLine(right, top, right, bottom, 1, ESP_Color, I::pDevice);
		D::DrawLine(right, bottom, left, bottom, 1, ESP_Color, I::pDevice);
	}
}
Credits :: smallC & dude719 from UC
please guys, give credits to real author of this code s0beit.
Quote Originally Posted by uNdExEd_CheAtEr View Post
please guys, give credits to real author of this code s0beit.
s0beit did not create this.

I got the original 3d box from iFlux but noticed the dimensions were wrong. It was taller than standing players and dwarfed crouching players. I wrote some code to automatically calculate box height, cleaned up his code a bit, and released this.

I gave credit where credit is due, and claiming I created no part of it? Honestly, fuck off.
Quote Originally Posted by Goocolax View Post
s0beit did not create this.

I got the original 3d box from iFlux but noticed the dimensions were wrong. It was taller than standing players and dwarfed crouching players. I wrote some code to automatically calculate box height, cleaned up his code a bit, and released this.

I gave credit where credit is due, and claiming I created no part of it? Honestly, fuck off.
not talking about you, but from jayjay153 and luizimloko post.
Quote Originally Posted by uNdExEd_CheAtEr View Post
not talking about you, but from jayjay153 and luizimloko post.
ohhhh my bad
i apologize
Quote Originally Posted by uNdExEd_CheAtEr View Post
not talking about you, but from jayjay153 and luizimloko post.
There's only some way to reach a goal ?, i'm not using s0beit's code, this code i adapted from my Warface source.

ptbr:

Em computação existe somente uma forma de se chegar em um objetivo ? eu não usei o código fonte do s0beit, neste caso eu adaptei do meu código fonte do Warface. Outro ponto a se observar é que em nenhum momento eu disse que "Criei" essa funcionalidade, só anexei á postagem onde existe a informação relacionada ao código.
Word2Screen
Quote Originally Posted by luizimloko View Post
Based on this article:
PT-BR ( https://pt.wikipedia.org/wiki/Caixa_...ra_m%C3%ADnima ).
EN-US ( https://en.wikipedia.org/wiki/Bounding_volume ).



Dynamic 3D Boxes based on player AABB.

Code:
template<class it, class actor>
void CESPFunctions<it, actor>::AABB3D( void ) const
{
	D3DXVECTOR3 vec[ 8 ] { D3DXVECTOR3( 0, 0, 0 ) };

	D3DXVECTOR3 max = this->getEntityIterator( )->getLTObject( )->BoxMax;
	D3DXVECTOR3 min = this->getEntityIterator( )->getLTObject( )->BoxMin;

	if( pEngine->worldToScreen( min, &vec[ 0 ] ) &&
	    pEngine->worldToScreen( max, &vec[ 1 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( max.x, min.y, min.z ), &vec[ 2 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( min.x, max.y, min.z ), &vec[ 3 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( min.x, min.y, max.z ), &vec[ 4 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( min.x, max.y, max.z ), &vec[ 5 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( max.x, min.y, max.z ), &vec[ 6 ] ) &&
	    pEngine->worldToScreen( D3DXVECTOR3( max.x, max.y, min.z ), &vec[ 7 ] ) )
	{
		pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 4 ].x, vec[ 4 ].y, Color( dwColor ) );
		pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 7 ].x, vec[ 7 ].y, Color( dwColor ) );
		pRender->Line( vec[ 2 ].x, vec[ 2 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
		pRender->Line( vec[ 3 ].x, vec[ 3 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );

		pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 2 ].x, vec[ 2 ].y, Color( dwColor ) );
		pRender->Line( vec[ 0 ].x, vec[ 0 ].y, vec[ 3 ].x, vec[ 3 ].y, Color( dwColor ) );
		pRender->Line( vec[ 7 ].x, vec[ 7 ].y, vec[ 2 ].x, vec[ 2 ].y, Color( dwColor ) );
		pRender->Line( vec[ 7 ].x, vec[ 7 ].y, vec[ 3 ].x, vec[ 3 ].y, Color( dwColor ) );

		pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );
		pRender->Line( vec[ 1 ].x, vec[ 1 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
		pRender->Line( vec[ 4 ].x, vec[ 4 ].y, vec[ 5 ].x, vec[ 5 ].y, Color( dwColor ) );
		pRender->Line( vec[ 4 ].x, vec[ 4 ].y, vec[ 6 ].x, vec[ 6 ].y, Color( dwColor ) );
	}
}
So how to transform the world postion to the screen position ,bro. such as 'pEngine->worldToScreen'. Is it the engine's function?
Quote Originally Posted by AkChen View Post
So how to transform the world postion to the screen position ,bro. such as 'pEngine->worldToScreen'. Is it the engine's function?
There's an engine function of worldtoscreen, or use can just create your own function, both works.
can I ask a very simple question?How the 'world2screen' works?
Posts 1630 of 32 · Page 2 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?