Results 1 to 7 of 7
  1. #1
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh

    Lots of different DrawPrim c++ code

    i like to just randomly read through sections of the Lithtech jupiter engine documentation all the time, and today i found all this code that has to do with DrawPrim. I know its important to you guys, although i don't know enough to know how lol anyway, here is what i found, hopefully you find it helpful.

    if DRAWPRIM_TRANSFORM_SCREEN is set for this call:
    Code:
    D3DVERTEXELEMENT9 decl_DrawPrimPosTColorTex[] =
    {
    	{ 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0 }, //size 16
    	{ 0, 16, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
    	{ 0, 20, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
    	D3DDECL_END()
    };
    
    HLSL Vertex Declaration 
    struct VERTEX_IN 
    {
    	float4 Position : POSITION0;
    	float4 Color 	: COLOR0;
    	float2 TexCoord : TEXCOORD0;
    };
    If DRAWPRIM_TRANSFORM_CAMERA or DRAWPRIM_TRANSFORM_WORLD is set for this call:
    Code:
    D3DVERTEXELEMENT9 decl_DrawPrimPosColorTex[] =
    {
    	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
    	{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
    	{ 0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
    	D3DDECL_END()
    };
    
    HLSL Vertex Declaration 
    struct VERTEX_IN 
    {
    	float3 Position : POSITION0;
    	float4 Color 	: COLOR0;
    	float2 TexCoord : TEXCOORD0;
    };
    if DRAWPRIM_TRANSFORM_SCREEN is set for this call:
    Code:
    D3DVERTEXELEMENT9 decl_DrawPrimPosTColor[] =
    {
    	{ 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0 }, //size 16
    	{ 0, 16, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
    	D3DDECL_END()
    };
    
    HLSL Vertex Declaration 
    struct VERTEX_IN 
    {
    	float4 Position : POSITION0;
    	float4 Color 	: COLOR0;
    };
    If DRAWPRIM_TRANSFORM_CAMERA or DRAWPRIM_TRANSFORM_WORLD is set for this call:
    Code:
    D3DVERTEXELEMENT9 decl_DrawPrimPosColor[] =
    {
    	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
    	{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
    	D3DDECL_END()
    };
    
    HLSL Vertex Declaration 
    struct VERTEX_IN 
    {
    	float3 Position : POSITION0;
    	float4 Color 	: COLOR0;
    };
    Particle Systems

    A particle system is an object created as OT_PARTICLESYSTEM. This can be done in game code, or as a ClientFX.

    Usage
    The texture applied to the particle system is passed in to the EffectShader as "texture0".

    To set the EffectShader id for a given OT_PARTICLESYSTEM, use the following function:
    ILTClient::SetParticleSystemEffectShaderID(HLOCALO BJ hObj, uint32 EffectShaderID);

    Vertex Format

    Code:
    D3DVERTEXELEMENT9 decl_Particles[] =
    {
    	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
    	{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, //size 12
    	{ 0, 24, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
    	{ 0, 28, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
    	D3DDECL_END()
    };
    
    HLSL Vertex Declaration 
    struct VERTEX_IN 
    {
    	float3 Position : POSITION0;
    	float3 Normal 	: NORMAL0;
    	float4 Color 	: COLOR0;
    	float2 TexCoord : TEXCOORD0;
    };
    PolyGrid

    A PolyGrid is an object created as OT_POLYGRID. These are grids of polygons generally used for water effects.

    Usage
    The texture applied to the PolyGrid is passed in to the EffectShader as "texture0". If an environment map is specified, it will be passed in as "texture1".
    Make sure that Additive, Multiply, Fresnel and NormalMapSprite are set to false.

    To set the EffectShader id for a given OT_POLYGRID, use the following function:
    ILTClient::SetPolyGridEffectShaderID(HLOCALOBJ hObj, uint32 EffectShaderID);

    Vertex Format
    Code:
    D3DVERTEXELEMENT9 decl_Polygrid[] =
    {
    	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
    	{ 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, //size 12
    	{ 0, 24, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
    	{ 0, 28, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
    	{ 0, 36, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0 },
    	{ 0, 48, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0 },
    	D3DDECL_END()
    };
    
    HLSL Vertex Declaration 
    struct VERTEX_IN 
    {
    	float3 Position : POSITION0;
    	float3 Normal 	: NORMAL0;
    	float4 Color 	: COLOR0;
    	float2 TexCoord : TEXCOORD0;
    	float3 Tangent : TANGENT0;
    	float3 Binormal : BINORMAL0;
    };
    Sprites

    Sprites are generated from the creation of an OT_SPRITE object, and consist of two polygons to form a plane.

    Usage
    The texture applied to the Sprite is passed in to the EffectShader as "texture0".

    To set the EffectShader id for a given OT_SPRITE, use the following function:
    ILTClient::SetSpriteEffectShaderID(HLOCALOBJ hObj, uint32 EffectShaderID);

    Vertex Format
    Code:
    D3DVERTEXELEMENT9 decl_Sprite[] =
    {
    	{ 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, //size 12
    	{ 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, //size 4 (one DWORD)
    	{ 0, 16, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, //size 8
    	D3DDECL_END()
    };
    
    HLSL Vertex Declaration 
    struct VERTEX_IN 
    {
    	float3 Position : POSITION0;
    	float4 Color 	: COLOR0;
    	float2 TexCoord : TEXCOORD0;
    };

    hopefully this is useful in some way!

    commando: You're probably the best non-coder coder I know LOL


  2. The Following 3 Users Say Thank You to supercarz1991 For This Useful Post:

    S0aD (04-26-2011),Tony Stark` (03-17-2011),wolffang0000 (03-16-2011)

  3. #2
    wolffang0000's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    here
    Posts
    597
    Reputation
    1
    Thanks
    165
    My Mood
    Relaxed
    very nice function, should help me a bit im missin this XD

  4. #3
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh
    i have more too just didn't post

    but what exactly is drawprim? lol

    commando: You're probably the best non-coder coder I know LOL


  5. #4
    Sydney's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Germany...
    Posts
    1,358
    Reputation
    37
    Thanks
    1,144
    My Mood
    Amused
    Quote Originally Posted by supercarz1991 View Post
    i have more too just didn't post

    but what exactly is drawprim? lol
    Drawprim most used way is in the WorldToScreen Function for ESP.

    Thanks Cosmos


  6. #5
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh
    Ahh so this code is either really good or useless haha

  7. #6
    wolffang0000's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    here
    Posts
    597
    Reputation
    1
    Thanks
    165
    My Mood
    Relaxed
    Quote Originally Posted by supercarz1991 View Post
    Ahh so this code is either really good or useless haha
    really good lol but i believe 2 of these are in gellin's base

    i used the texttoworld in a part of my ESP just now so ty'ed

  8. #7
    supercarz1991's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    North of Hell, South of Heaven
    Posts
    6,067
    Reputation
    323
    Thanks
    3,323
    My Mood
    Doh
    Quote Originally Posted by wolffang0000 View Post
    really good lol but i believe 2 of these are in gellin's base

    i used the texttoworld in a part of my ESP just now so ty'ed
    these are straight from the lithtech jupiter enterprise documentation. so he could have found it before me and used it

    commando: You're probably the best non-coder coder I know LOL