• Advertisement

myers80

Member
  • Content count

    24
  • Joined

  • Last visited

Community Reputation

194 Neutral

About myers80

  • Rank
    Member
  1. Using genetic algorithms to 'train' my AI

    Interesting project; I like GAs.  I didn't see it mentioned in your blog, but are you using elitism?  That is, letting your best performer(s) through to the next generation unaltered?  It's a good way to ensure you don't lose your best candiates to a bad crossover.
  2. 2D array and pointers

    When arrays are passed to functions they decay to pointers to their first element.  big_matrix is an array of 10 arrays of 10 doubles, so when it's passed to reset_2D_dbl_array it decays to a pointer to an array of 10 doubles (i.e. double [10][10] decays to double(*)[10], not double**).   In your second example, big_matrix[0] is an array of 10 doubles, so it would decay to a pointer to a double (i.e. double[10] decays to double*).
  3. A bummer that Linux does not make it easy.  I will continue to look into it and report back if I figure it out.  Thanks for the reply.
  4.   I'm not sure the system locale is what I'm looking for.  I need a way to determine what the keyboard's layout is (i.e. qwerty or dvorak).  So far it looks like XkbLayout might have this information.  Does anyone know if that is the case?
  5. Is there a unix and mac equivalent to the window's function GetKeyboardLayoutName, which retrieve's the system's active input locale identifier?  Thanks!
  6. Well for anyone curious, I found a good tutorial and was able to figure it out.  There were a few additional things I had to do that the tutorial didn't really cover.   I placed a copy of the Windows SFML 2.0 release client in my project directoy.  I also placed lib files from the Unix version of SFML into the lib folder of my SFML copy.   Before calling, find_package(SFML..., I had to set the directory for where SFML was located:     set(SFMLDIR "${CMAKE_SOURCE_DIR}/../SFML-2.0-rc")   I couldn't find a way to get the SFML dlls to copy to where the executable is generated, so I just statically linked them (which is probably what I should be doing anyways):     set(SFML_STATIC_LIBRARIES TRUE)
  7. I'm creating a c++ game engine, and I intend to use SFML for the graphics, audio, and input.  I'm also using cmake to generate my build files, so that I have an easy way to test it across multiple OS'.  I'm wondering what the correct/proper approach is to integrating SFML into a setup like this.   Should I have a copy of the SFML libraries for each OS (win/unix/mac), and somehow specify in CMake which of the libraries to include?  Or do I include the SFML source into my project source and build the libraries along with my project?   My engine is building its own shared libraries and linking to those, so I understand the basics of this.  I'm just not sure how I should be including other people's libraries into my project, and making it so that it functions across multiple OS'.  Thanks.
  8. HLSL Diffuse shader

    You need to also transform the input normal by the (3x3) of the view transformation.
  9. Learning directX

    [quote name='EpicViTTo23' timestamp='1311051667' post='4837210'] thank you for your response, i have tried books but not that one so i will deffinatly look into it and your right the tutorials in the sdk arent very good for a complete newbie to graphics how similar is 10 to 11? is it close enough i could learn the basics and be ok? is it any easier to learn 10 rather than 11 first? thx! [/quote] From what I understand DX10 and DX11 are very similar, although I skipped DX10 so I can't say for sure. I don't think one is really easier than the other, just new features and some different syntax. Check out that rastertek site. He does a pretty good job of explaining everything and has source code for you to download. Step through all of the code and make sure you understand what is going on. If there is a particular function call or argument you don't understand look it up on msdn. If you can work your way through those first 4 tutorials on his site you will be well on your way. Feel free to PM me if you get stuck, I know how overwhelming this stuff can be at first.
  10. Learning directX

    [quote name='EpicViTTo23' timestamp='1311036801' post='4837122'] Hey everyone, i have been trying to learn DirectX11 for a few weeks now and honestly i don't think i have learned much of anything... so my question is, how did you learn DirectX and what do you think is the best way? Any info would be great becuase i'm really having a rough time with this. [/quote] I would definitely recommend picking up a book if you haven't yet. I learned DirectX from working my way through Frank Luna's book, "Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach", which I thought was a very good book. Just recently I began working my way through the tutorials on rastertek.com to teach myself DirectX11. Luna does have a DirectX10 book, which from what I understand is very similar to DirectX11 so that might be a good bet. There are also loads of examples that come with the DirectX SDK but if you've never done graphics programming before you'd probably have an easier time learning from a book.
  11. Mouse picking problem

    [quote name='rzn' timestamp='1310042498' post='4832235'] vPickRayOrig -= vPickRayDir*(m_cam->GetDistance() / vPickRayDir.z);[/code] [/quote] Are you sure this last line is needed? I have a similar function, but it does not do that last part. I'm also doing the inverse world and view, not just the inverse view. Not sure if either of those are you problem though.
  12. [quote name='MrSplosion' timestamp='1309999937' post='4832032'] Ok I got to step 2 [img]http://public.gamedev.net/public/style_emoticons/default/blink.gif[/img] there is no Property Manager under View. I'm using the Express Edition btw if that has anything to do with it. [/quote] I'm not sure how to set it up for all future projects like the post above was doing, but to set it up for one project. 1. View -> Solution Explorer 2. Right click on the project name in the solution explorer and select properties 3. Under configuration properties select VC++ directories 4. You will need to have this point to both the include and library directories of the DirectX SDK you downloaded.
  13. That's slick! Thanks for the tip.
  14. Edit: I just fixed it. In case anyone is curious the fix was, for polygonLayout[2] the AlignedByteOffset needs to be set to 12, since polygonLayout[1] is 12 bytes. I have a simple shader that paints the pixels a color, and I'm trying to get this to work with instancing. My vertex layout contains the vertex position, the instanced object's position, and the instanced object's color. The objects appear in the correct position on the screen, so the instanced object's position is getting read correctly, however the color is not correct. My first thought is that I'm am incorrectly creating the vertex layout. Is this the correct way to do it for what I want? [code] // Create the vertex input layout description. D3D11_INPUT_ELEMENT_DESC polygonLayout[3]; polygonLayout[0].SemanticName = "POSITION"; polygonLayout[0].SemanticIndex = 0; polygonLayout[0].Format = DXGI_FORMAT_R32G32B32_FLOAT; polygonLayout[0].InputSlot = 0; polygonLayout[0].AlignedByteOffset = 0; polygonLayout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA; polygonLayout[0].InstanceDataStepRate = 0; polygonLayout[1].SemanticName = "TEXCOORD"; polygonLayout[1].SemanticIndex = 0; polygonLayout[1].Format = DXGI_FORMAT_R32G32B32_FLOAT; polygonLayout[1].InputSlot = 1; polygonLayout[1].AlignedByteOffset = 0; polygonLayout[1].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA; polygonLayout[1].InstanceDataStepRate = 1; polygonLayout[2].SemanticName = "TEXCOORD"; polygonLayout[2].SemanticIndex = 1; polygonLayout[2].Format = DXGI_FORMAT_R32G32B32A32_FLOAT; polygonLayout[2].InputSlot = 1; polygonLayout[2].AlignedByteOffset = 0; polygonLayout[2].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA; polygonLayout[2].InstanceDataStepRate = 1; [/code] And inside my vertex shader the structure is, struct VS_INPUT { float4 position : POSITION; float3 instPos : TEXCOORD0; float4 instColor : TEXCOORD1; };
  15. Spent all weekend reorganizing and cleaning up the code, and at some point I fixed the issue! No really sure exactly what was wrong but I'm thinking some uninitialized memory, which has bitten me in release mode more than once. Good lesson for myself, first clean up the code before going bug hunting ;) Thanks MJP and TiagoCosta for the help.
  • Advertisement