• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

MefistoManna

Members
  • Content count

    25
  • Joined

  • Last visited

Community Reputation

139 Neutral

About MefistoManna

  • Rank
    Member
  1. Now I release all and it's working, thank you very much!
  2. Do I have to reset my device? because if I use only this function, I get blackscreen.
  3. I am Initializing directx in this way: [source lang="cpp"] D3DPRESENT_PARAMETERS d3dpp; LPDIRECT3D9 g_pD3D = NULL; if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) ) return false; ZeroMemory( &d3dpp, sizeof(d3dpp) ); d3dpp.Windowed = true; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8; d3dpp.AutoDepthStencilFormat = D3DFMT_D16; d3dpp.BackBufferCount = 1; d3dpp.MultiSampleQuality = 0; d3dpp.hDeviceWindow = hwnd; d3dpp.EnableAutoDepthStencil = true; d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8; d3dpp.Flags = 0; d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; d3dpp.MultiSampleType = D3DMULTISAMPLE_8_SAMPLES; //d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_D3DDevice ) ) )[/source] Now how can I change after initialization my settings (for example MultiSampleType)? Sorry for stupid question.
  4. I want to get this result [url="http://www.ventuz.com/support/help/v3_01/TransformationGizmo.html"]http://www.ventuz.co...ationGizmo.html[/url] in my editor for translate, rotate and scale my mesh. But how can I do? I am quite confused. Can I use a mesh for the arrows? ps: My picking system working perfectly for one or more mesh. Thanks you.
  5. Hi guys, I am working on a lever editor, I already make a picking, now, for traslate, scale and rotate the meshes I am going to render the arrows (udk, cryengine 3 style): [IMG]http://i45.tinypic.com/1givph.png[/IMG] but they have to: Always point along the x ,y and z axis. Always extend from the center of the object. Always the same size; I don't have any idea for do this.How can I do? Do I have to do with a mesh? Sorry for my english.
  6. ahhh for the moment it's working, but if there is a clearest method it' s better.
  7. Thanks again, I modified my code like you [i]said[/i]...it's incredible still don't work for scaled mesh... I did some research and this is my same problem [url="http://www.gamedev.net/topic/386313-picking-the-closest-mesh-problem/"]http://www.gamedev.n...t-mesh-problem/[/url] but a concrete solution I did't find. EDIT. I solved by multiply the maximum scale factor of 3 dimensions (x,y,z) for the distance, thanks for your help.
  8. It still don't work [img]http://public.gamedev.net//public/style_emoticons/default/wacko.png[/img] .I am doing in this way: [source lang="cpp"] g_D3DDevice_->GetTransform(D3DTS_PROJECTION, &matProj ); g_D3DDevice_->GetTransform(D3DTS_VIEW, &matView); g_D3DDevice_->GetTransform(D3DTS_WORLD, &matWorld); g_D3DDevice_->GetViewport( &m_Viewport ); D3DXMatrixInverse(&ImatView, NULL, &matView ); D3DXMatrixInverse(&ImatWorld, NULL, &matWorld); v.x = ( ( ( 2.0f * Cursor.x ) / m_Viewport.Width ) - 1 ) / matProj._11; v.y = -( ( ( 2.0f * Cursor.y ) / m_Viewport.Height ) - 1 ) / matProj._22; v.z = 1.0f; D3DXMATRIX mWorldView = matWorld * matView; D3DXMATRIX m; D3DXMatrixInverse( &m, NULL, &mWorldView ); rayDir.x = v.x * m._11 + v.y * m._21 + v.z * m._31; rayDir.y = v.x * m._12 + v.y * m._22 + v.z * m._32; rayDir.z = v.x * m._13 + v.y * m._23 + v.z * m._33; rayOrigin.x = m._41; rayOrigin.y = m._42; rayOrigin.z = m._43; D3DXVec3TransformCoord(&rayOrigin,&rayOrigin,&ImatWorld); D3DXVec3TransformNormal(&rayDir,&rayDir,&ImatWorld); D3DXVec3Normalize(&rayDir,&rayDir); D3DXIntersect(g_Mesh[NumModel], &rayOrigin, &rayDir, &picked, NULL, NULL, NULL, &dist, AllHit, HitCount); [/source] If I multiply matworld and matview the picking is completly wrong.
  9. Thanks ankhd, I do this, and it works perfectly, but the problem is when the mesh is traformed. I think that it' s a wrong use of matrix. Do I have to use the inverse of matrix obtained with the function GetTrasform or the matrix of single mesh?
  10. Hi guys, sorry for my English, I have this problems with picking ray on multiple mesh: 1) if I get the world matrix in this way (with GetTrasform) , the picking result is wrong when I traslate or scale the meshes (work on original position or size) 2) Else if I pass in the function the single meshes 's world matrix (array) the result is correct but if I scale the mesh, the ray pick more distant mesh and I have to get close for get the correct result. Here is my code (I have other function that get the closest mesh, but I am sure that the problems is here): [source lang="cpp"] if(m_Input::MouseButtonDown(0)) { g_D3DDevice_->GetTransform(D3DTS_PROJECTION, &matProj ); g_D3DDevice_->GetTransform(D3DTS_VIEW, &matView); g_D3DDevice_->GetTransform(D3DTS_WORLD, &matWorld); g_D3DDevice_->GetViewport( &m_Viewport ); D3DXMatrixInverse(&ImatView, NULL, &matView ); D3DXMatrixInverse(&ImatWorld,NULL,&matWorld); v.x = ( ( ( 2.0f * Cursor.x ) / m_Viewport.Width ) - 1 ) / matProj._11; v.y = -( ( ( 2.0f * Cursor.y ) / m_Viewport.Height ) - 1 ) / matProj._22; v.z = 1.0f; rayDir.x = v.x*ImatView._11 + v.y*ImatView._21 + v.z*ImatView._31; rayDir.y = v.x*ImatView._12 + v.y*ImatView._22 + v.z*ImatView._32; rayDir.z = v.x*ImatView._13 + v.y*ImatView._23 + v.z*ImatView._33; rayOrigin.x = ImatView._41; rayOrigin.y = ImatView._42; rayOrigin.z = ImatView._43; D3DXVec3TransformCoord(&rayOrigin,&rayOrigin,&ImatWorld); D3DXVec3TransformNormal(&rayDir,&rayDir,&ImatWorld); D3DXVec3Normalize(&rayDir,&rayDir); D3DXIntersect(g_Mesh[NumModel], &rayOrigin, &rayDir, &picked, NULL, NULL, NULL, &dist, NULL, NULL); if(picked) { NumMeshHit[NumHit] = NumModel; MeshDist[NumHit] = dist; NumHit++; } } [/source] Sorry again for my bad English.
  11. Any idea? How is it possible? How do you do for trasformated mesh picking?
  12. I read this: [url="http://www.gamedev.net/topic/559814-incorrect-picking-of-scaled-models/"]http://www.gamedev.net/topic/559814-incorrect-picking-of-scaled-models/[/url] and this is a big problem because nobody understood how to do. But these are very old discussion. Currently, there are somebody that know how fix it?
  13. Thanks, you were very helpful. I will do more experience and I will understand how to do progressively.
  14. What kind of things can I do and what can't I do for earn any FPS? Sorry for my bad English and thanks you.
  15. Sorry for my english ;). I picked mesh with this code: [CODE] void :Pick(int Num, std::vector<LPD3DXMESH> g_Mesh) { if(m_Input::MouseButtonDown(0)) { POINT Cursor; GetCursorPos( &Cursor ); ScreenToClient( m_Input::GetHandle(), &Cursor ); D3DVIEWPORT9 m_Viewport; g_D3DDevice_->GetViewport( &m_Viewport ); D3DXVECTOR3 v; D3DXMATRIX matProj; g_D3DDevice_->GetTransform( D3DTS_PROJECTION, &matProj ); v.x = ( ( ( 2.0f * Cursor.x ) / m_Viewport.Width ) - 1 ) / matProj._11; v.y = -( ( ( 2.0f * Cursor.y ) / m_Viewport.Height ) - 1 ) / matProj._22; v.z = 1.0f; D3DXMATRIX m; D3DXVECTOR3 rayOrigin,rayDir; D3DXMATRIX view; g_D3DDevice_->GetTransform(D3DTS_VIEW, &view); D3DXMatrixInverse( &m, NULL, &view ); rayDir.x = v.x*m._11 + v.y*m._21 + v.z*m._31; rayDir.y = v.x*m._12 + v.y*m._22 + v.z*m._32; rayDir.z = v.x*m._13 + v.y*m._23 + v.z*m._33; rayOrigin.x = m._41; rayOrigin.y = m._42; rayOrigin.z = m._43; D3DXMATRIX matInverse; D3DXMATRIX world; g_D3DDevice_->GetTransform(D3DTS_WORLD, &world); D3DXMatrixInverse(&matInverse,NULL,&world); D3DXVECTOR3 rayObjOrigin,rayObjDirection; D3DXVec3TransformCoord(&rayObjOrigin,&rayOrigin,&matInverse); D3DXVec3TransformNormal(&rayObjDirection,&rayDir,&matInverse); D3DXVec3Normalize(&rayObjDirection,&rayObjDirection); D3DXIntersect(g_Mesh[Num], &rayObjOrigin, &rayObjDirection, &picked, NULL, NULL, NULL, &dist, NULL, NULL); if(picked) { picked[Num] = true; } } } [/CODE] Now, if the mesh is scaled or rotated, this work perfectly. But when it is translated the code doesn't work because after the trasformation, i can pick the mesh only at initial point (0, 0, 0). What can I do? I readed other discussion but i don't find the solution.