• 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.

regexian

Members
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

102 Neutral

About regexian

  • Rank
    Newbie
  1. Cool...very nice to know how that function works behind the scenes. I still have a problem, though. By using the existing WorldViewProjection matrix with D3DXVec3Project, the position where the sprite is vastly [b]incorrect[/b] (however, it still rendered at some random position depending on my camera angle). Currently I call the function as: [CODE] D3DXMATRIX matWorldViewProj; GetVertexShaderConstantF(8, matWorldViewProj, 4); ... D3DXVec3Project(&vecOutput,&vecPosition,&Viewport,&matWorldViewProj, &matIdentity, &matIdentity);[/CODE] I thought that my problem had to do with the fact that normally I would call the function as: [CODE]D3DXVec3Project(&vecOutput,&vecPosition,&Viewport,&matProj, &matView, &matIdentity);[/CODE] ...which would be calling D3DXVec3Project with a View * Projection matrix (since World is now an identity matrix). This is how I would call it in all other games to get the desired sprite position. I thought I was going in the right direction when comparing this with previous methods, so then I noticed that there was a World matrix register (gWorld c0 4). So I took the inverse of that and multiplied it with WorldViewProjection because (WorldViewProjection) x ([World][sup]-1[/sup]) = (ViewProjection). I passed that to D3DXVec3Project, tested it in-game, and nothing rendered (the x and y positions were out of screen space (coordinates of 100000+ for x and y)). I understand why the WorldViewProjection matrix didn't work, but now I'm confused what to do since my intuition also failed. It sucks that I don't have a ViewProj matrix like most games to work off of. All I have is a ViewInv (inversed view) matrix, a WorldViewProj matrix, and a World matrix. Is there any way to put the matricies I have together and pass them into D3DVec3Project to get my desired result? :/
  2. Hey, First and foremost, I am not that familiar with the D3D scene of things (no pun intended), so all and any help would be appreciated. I am currently working with a game which has a pure device, and this means that the buffered-state get functions fail, of course (i.e. GetTransform, GetViewport, etc.). Additionally, SetTransform does not get called, so I can't internally set a temporary variable to store the last known projection and view transformation matricies. What I am trying to accomplish is to render a rectangle at a certain coordinate in the game. On non-pure devices, this is a very simple process, as I would just grab D3DTS_VIEW, D3DTS_PROJECTION, the viewport, an identity matrix, and the world coordinate, and throw them into the nice and friendly D3DXVec3Project function to get the screen space coordinate from the world coordinate. However, in this particular game, I didn't have such luxuries. I read some articles online, where I discovered that the game is shader-based and that I could potentially grab the projection and view matricies from the shader registers. Here is an excerpt of the dump from the shader file which lists all of these registers: [CODE] // Registers: // // Name Reg Size // ---------------- ----- ---- // gWorld c0 4 // gWorldViewProj c8 4 // gViewInverse c12 4 // globalScalars c39 1 // globalScalars2 c40 1 // gDayNightEffects c45 1 // globalAnimUV0 c208 1 // globalAnimUV1 c209 1 // [/CODE] Now, unlike some games, I now realized that there wasn't individual matricies, which could be passed into D3DXVec3Project. I assume the only one which I would need is the gWorldViewProj matrix (WorldViewProjection = World * View * Projection). The problem is what to do with it. I also read that transforming that matrix using the point and the function D3DXVec3TransformCoord would NOT put it into screen coordinates: instead, it would put it into projection clip coordinates. Therefore, my best guess would be to somehow fit it into the D3DXVec3Project function. Let's show some sample code to work off of: [CODE] . . . // The location of the entity in the world where I want to draw the sprite on top of. D3DXVECTOR3 vecPosition(-100.5f, 1000.f, 15.f), vecOutput; . . . D3DVIEWPORT9 Viewport = {0, 0, 1920, 1080, 0, 1}; . . . // Grab the WorldViewProjection matrix from the shader buffer at register 8 as 4 float4's. D3DXMATRIX matWorldViewProj; pDevice->GetVertexShaderConstantF(8, matWorldViewProj, 4); . . . D3DXVec3Project(&vecOutput, &vecPosition, &Viewport, ???, ???, ???); [/CODE] This is really a learning experience for me, if anything. If and when it works, I can start playing around with the shader information (as I'm also new to that concept) and hopefully gain an appreciation for what's going on behind the scenes. Do I have the right idea? Do I need to manually transform the matricies? Is this even possible, given my limitations? Thanks again!