• Advertisement

Cigguh

Member
  • Content count

    38
  • Joined

  • Last visited

Community Reputation

124 Neutral

About Cigguh

  • Rank
    Member
  1. Hi. I'm looking for simple RSA and Elgamal sources in c# or c++. Everything i've found on the net was uncommented or just has miles of code. It's for my friend so i don't really need (and don't want) to start from scratch, plus program should be done in few days. Thanx for your help.
  2. See through terrain glitch

    It also happens if you set near Z clip distance in your projection matrix to "0.0".
  3. Saving Player Information?

    1 tutorial 2 tutorial
  4. Dot line in directx8

    Use ID3DXLine interface. With it you can simple draw dash and/or dotted lines by setting pattern with ID3DXLine::SetPattern() function.
  5. camera

    I did thing like that without any problems using just formula matFinal = matCenterOfRotation * matScaling * matRotation * matTranslation; where: matCeneterOfRotation - D3DXMatrixTranslation result (center point of rotation ) matScaling - D3DXMatrixScaling result (object scaling matrix) matRotation - D3DXMatrixRotationYawPitchRoll result (angle x,y,z to rotate) matTranslation - D3DXMatrixTranslation result (distance from center of rotation) use "0.0, 0.0, -zDist" as parameter to move camera back from rotation center.
  6. Combining two textures

    I did it that way: Got 3 textures, for example: grass, sand, cement. Got another texture (painted in photoshop) where red channel - ammount of grass, green - ammount of sand, blue - cement. I only needed 3 textures but if you want more then just add with this principle. My pixel shader for that: float4 PS_RELIEF_LQ( VS_OUT_RELIEF IN ) : COLOR { // diffuse textures float4 Diff0 = tex2D( sampTex0, IN.tex0 ); float4 Diff1 = tex2D( sampTex1, IN.tex1 ); float4 Diff2 = tex2D( sampTex2, IN.tex2 ); // Mix texture float4 Mix = tex2D( sampTexMM, IN.tex3 ); // Shadowmap texture float4 SM = tex2D( sampTexSM1, IN.tex3 ); // Combining diffuse textures using mix texture float4 Col = ( Diff0 * Mix.r ) + ( Diff1 * Mix.g ) + ( Diff2 * Mix.b ); Col = Col * SM; return Col; }
  7. Name the effect!

    Hmm... If i was trying to do something like that i would assume that it is a simple sprite with one-one alpha blend with some radial noise on alpha channel. Can't be sure, but i think even if it's not what i think my method would look pretty the same. I don't think that animated mesh or texture coordinater are needed, you can draw that ring with a simple circle formula. EDIT: I didn't play B & W and like dgreen02 said it's really hard to tell without animation. But if looks like he described then it should be particles positioned with ring formula, i think. [Edited by - Cigguh on March 25, 2007 2:18:08 AM]
  8. Yeh sure, i forgot. I took 5-th texcoord out for the shader (lil bit later) to compile it under PS1.1
  9. Thank you for the explanation!
  10. Combining two textures

    I'm not really sure about what you're tryna do but check out function D3DXLoadSurfaceFromSurface. Here's what i found in i-net few months ago don't remember the link to the example so i'll post only the part of it (actually function that probably does what you need ): void loadSubTexture( void ) { LPDIRECT3DTEXTURE9 pSubTexture = NULL; LPDIRECT3DSURFACE9 pDestSurface = NULL; LPDIRECT3DSURFACE9 pSrcSurface = NULL; D3DXCreateTextureFromFile( g_pd3dDevice, "tex64.bmp", &pSubTexture ); g_pTexture->GetSurfaceLevel( 0, &pDestSurface ); pSubTexture->GetSurfaceLevel( 0, &pSrcSurface ); RECT srcRect[] = { 0, 0, 64, 64 }; RECT destRect[] = { 32, 32, 96, 96 }; D3DXLoadSurfaceFromSurface( pDestSurface, NULL, destRect, pSrcSurface, NULL, srcRect, D3DX_DEFAULT, 0); pSrcSurface->Release(); pDestSurface->Release(); pSubTexture->Release(); } Not sure was that what you need :-P Or there's a better way... use shaders.
  11. Hi. I wrote an effect file that works fine but only under PS_2_0, i also wanna make technique to run it under PS_1_1 for better compatibility. I cutted down instructions to make them fit 1_1 version limits but i used all 8 TEXCOORDs for my high quality technique and for low quality one i need only 5 TEXCOORDs. Should i change my vertex declaration from: D3DVERTEXELEMENT9 declMesh1[] = { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, { 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, { 0, 32, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 }, { 0, 40, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 2 }, { 0, 48, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 3 }, { 0, 56, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 4 }, { 0, 64, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 5 }, { 0, 72, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 6 }, { 0, 80, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 7 }, D3DDECL_END() }; to a: D3DVERTEXELEMENT9 declMesh1[] = { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0 }, { 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, { 0, 32, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1 }, { 0, 40, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 2 }, { 0, 48, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 3 }, { 0, 56, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 4 }, D3DDECL_END() }; or i can just take them out of my vertexinput structure in shader and directx will handle it by itself? (i hope it will). Thanks for your help.
  12. bumpin thread again... I mean: bullet holes, skid marks, shadows etc.
  13. Hi. I need to put a decal on the mesh. The problem is that i couldn't find any good help on this problem. For example: i have textured landscape mesh and i need to put an explosion decal on it (on the next texture stage). Decal should be placed exactly in the rectangle i define as two vectors (left-botom, right-top). Hope you've got the idea. I tried different methods i could came up with but none worked out :( Please provide me with some code samples if it's possible. Thx alot. Oh yeah, i don't want to copy surfaces for this effect.
  14. Can't see my triangle

    It seems that you just draw your triangle faced away from your camera. Change your order to a clockwise so you'll have something like this: CUSTOMVERTEX t_vert[] = { ( 120.0f, 400.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(255,0,0) ), ( 520.0f, 400.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(0,255,0) ), ( 320.0f, 50.0f, 0.5f, 1.0f, D3DCOLOR_XRGB(0,0,255) ) }; The default value for culling in DirectX is 'D3DCULL_CCW'. But you can change it with d3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ); // draw all faces d3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CW ); // cull clockwise d3dDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_CCW ); // cull counterclockwise And make sure that you have your camera position and look direction right. I'd use D3DXMatrixLookAtLH() function to check results. EDIT: By the way using defines for FVF becomes a problem when you have lots of custom vertex types. For example i use this kind of structure for easier access to FVF bit mask: typedef struct CUSTOMVERTEX { D3DXVECTOR3 pos; D3DXVECTOR2 tex; enum { FVF = D3DFVF_XYZ | D3DFVF_TEX1 }; } CUSTOMVERTEX; 'CUSTOMVERTEX::FVF' is clearer than searching for defined names.
  • Advertisement