Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Game Development › DirectX/D3D Development › Raidez World to Screen

Raidez World to Screen

Posts 1–2 of 2 · Page 1 of 1
NT
ntKid
Raidez World to Screen
W2S for new PW/Frogster game Raiderz.
http://raiderz.perfectworld.com/

If this is usefull for you please credit me and mpgh.net

Code:
std::vector< D3DXVECTOR3 > m_ModelInfo;

HRESULT GetVertexPosition( LPDIRECT3DDEVICE9 lpDevice, D3DXVECTOR3& lpWorldPosition )
{
	HRESULT Eax = E_UNEXPECTED;

	LPDIRECT3DINDEXBUFFER9 dwIndexData = NULL;

	if( SUCCEEDED( lpDevice->GetIndices( &dwIndexData ) ) )
	{
		PVOID dwIndex = NULL;

		if( SUCCEEDED( dwIndexData->Lock( 0, 0, &dwIndex, D3DLOCK_READONLY ) ) )
		{
			LPDIRECT3DVERTEXBUFFER9 dwStreamData = NULL;

			UINT dwOffsetInBytes = NULL, dwStride = NULL; 

			if( SUCCEEDED( lpDevice->GetStreamSource( 0, &dwStreamData, &dwOffsetInBytes, &dwStride ) ) )
			{
				PVOID dwData = NULL;

				if( SUCCEEDED( dwStreamData->Lock( 0, 0, &dwData, D3DLOCK_READONLY ) ) )
				{
					Eax = NO_ERROR;

					lpWorldPosition.x = ( ( PFLOAT )dwData )[ 0 ];
					lpWorldPosition.y = ( ( PFLOAT )dwData )[ 1 ];
					lpWorldPosition.z = ( ( PFLOAT )dwData )[ 2 ];

					dwStreamData->Unlock( );
				}
				dwStreamData->Release( );
			}
			dwIndexData->Unlock( );	
		}
		dwIndexData->Release( );
	}

	return Eax;
}

VOID AddDeviceModel( LPDIRECT3DDEVICE9 lpDevice )
{
	D3DXVECTOR3 dwWorldPosition( 0, 0, 0 );

	if( FAILED( GetVertexPosition( lpDevice, dwWorldPosition ) ) )
		return;

	D3DVIEWPORT9 dwViewPort;

	ZeroMemory( &dwViewPort, sizeof( D3DVIEWPORT9 ) );

	if( FAILED( lpDevice->GetViewport( &dwViewPort ) ) )
		return;

	D3DXMATRIX dwWorldViewProj;

	ZeroMemory( &dwWorldViewProj, sizeof( D3DVIEWPORT9 ) );

	if( FAILED( lpDevice->GetVertexShaderConstantF( 216, ( PFLOAT )&dwWorldViewProj, 4 ) ) )
		return;

	if( D3DXMatrixTranspose( &dwWorldViewProj, &dwWorldViewProj ) == NULL )
		return;

	D3DXVECTOR3 dwScreenPos( 0, 0, 0 );

	if( D3DXVec3TransformCoord( &dwScreenPos, &dwWorldPosition, &dwWorldViewProj ) )
	{
		dwScreenPos.x = ( dwScreenPos.x + 1.0f ) * dwViewPort.Width * 0.5f + dwViewPort.X;
		dwScreenPos.y = ( 1.0f - dwScreenPos.y ) * dwViewPort.Height * 0.5f + dwViewPort.Y;
		dwScreenPos.z = ( dwScreenPos.z + 1.0f ) * 0.5f;
		
		m_ModelInfo.push_back( dwScreenPos );
	}
}
Example:
Code:
VOID PrintPosition( LPDIRECT3DDEVICE9 lpDevice )
{
	if( lpDevice )
	{
		if( pFontManager )
		{
			for( INT i = 0; i < m_ModelInfo.size( ); i++ )
			{
				pFontManager->OnDraw( NULL, ( INT )m_ModelInfo[ i ].x, ( INT )m_ModelInfo[ i ].y, NULL, NULL, "LA", DT_NOCLIP, D3DCOLOR_ARGB( 255, 255, 255 ,255 ) );
			}	
		}
	}
}

HRESULT __stdcall myEndScene( LPDIRECT3DDEVICE9 Device )
{
	PrintPosition( Device );

	m_ModelInfo.clear( );

	return pEndScene( Device );
}

HRESULT __stdcall myDrawIndexedPrimitive( LPDIRECT3DDEVICE9 Device, D3DPRIMITIVETYPE Type, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount )
{
	if( pTextureManager->GetActiveTextureId( ) == 0x9CDE3DBB || pTextureManager->GetActiveTextureId( ) == 0xFDA64A00 )
	{
		AddDeviceModel( Device );//W2S + Store ScreenPos
	}			
	return pDrawIndexedPrimitive( Device, Type, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount );
}
#1 · 14y ago
MarkHC
MarkHC
Good to see people sharing this kinda stuff. +Rep
#2 · 14y ago
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

  • World 2 Screen?By Xlilzoosk8rX in Combat Arms Coding Help & Discussion
    30Last post 15y ago
  • What is World To Screen?By u.A.v.A in Coders Lounge
    3Last post 14y ago
  • NFL - Army Ranger - World News - Now, the Movie ScreenBy Jabuuty671 in General
    10Last post 16y ago
  • Hacking world of warcraft? & a noob questionBy arsholio in General Game Hacking
    9Last post 20y ago
  • World jump dayBy -Avenger- in General
    4Last post 20y ago

Tags for this Thread

None