Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 20 Apr 2013
Offline Last Active Aug 24 2015 09:05 AM

#5204495 Where should i start with programming?

Posted by on 15 January 2015 - 09:33 AM

You might find this useful:


#5203651 Whats the task of the programmer in this video game?

Posted by on 12 January 2015 - 05:53 AM

Lighxbulb where did you spotted 3D in the environnement?


In the first video in pretty much all of the fight scenes (ex 1:35) you can see that from the rotation of the camera. After you enter a crystal (ex 3:15), and I would say even in the rest of the cases(not obvious though) you have some simplistic but textured 3d geometry (I just assume it would be easier than to mix in a 2d background with 3d objects (monsters, character, crystals) in the front). 3d is an extension to 2d, so what you can make in 2d you can make in 3d too and more(you could just use a textured quad to represent a 2d image in 3d for example).

#5203438 Where to deeply learn Direct3D/X ?

Posted by on 11 January 2015 - 05:00 AM





#5200464 Mathematics?

Posted by on 28 December 2014 - 04:18 PM


I passed the standard grades with top marks in computing and music

Ironically, those are two subjects that are intensely based on mathematics.  Programming, music, and physics are all just different (or not so different) aspects of applied mathematics.


   I don't want to argue, but you don't really need any math for most of the fields in music. To perform music on an instrument - you do not need mathematics, to conduct - you do not need mathematics, to compose -  you still do not need mathematics, maybe the closest thing where you need to "think mathematically" is harmony - but still you don't need to know math to harmonize a melody - you just need to know a set of rules an be creative sometimes. In music you need fine hearing, creativity, and musical intuition. Music is art, mathematics is science. So there's nothing ironic, really.

#5199244 I need help with some maths

Posted by on 20 December 2014 - 07:25 AM

normalize(t-p) = t-p/|t-p|, where |t-p| is the length (a scalar) of the vector t-p. This is pretty basic stuff - maybe you should pick up some analytical geometry/linear algebra?

struct Vector2
    float x, y;

    Vector2& normalize()
        float d = sqrt(x*x + y*y);
        x /= d;
        y /= d;

        return *this;


#5198955 C++ | DirectX | Class system ?!

Posted by on 18 December 2014 - 10:16 AM

C++ Primer is a good book. The only point holding me is, that it's in english. Thats kinda 3 times harder than reading a book in my motherlanguage. I will think of it.


I can't help you with this - either learn English or find a good book in your language. There's plenty of good literature on programming/3d etc. subjects in English, I have no idea about other languages though.


Now the solution is, that for multiple pointers i have to put it in brackets ? Like :


Object ****obj


...function(Object ****obj)



Nah, it has to do with the * operator. It means different thing depending on where you use it. But that's what I am talking about - this is basics - pointers, aliases, dereferencing etc.  are in the first chapters of most books.


If you feel not pissed enough to awnser another question, read below, otherwise better stop here smile.png.


Nah, I am not pissed - I'm just trying to make the point that you won't go too far if you depend for every line of code on the forum community.


A copy-paste of the error would have helped. Usually linker errors stem from a redefinition of a function/class/method or a lack of definition. Let's say for example I declare a function:

void doSomething();

If I try to use this function without providing its definition (the body of the function), I'll get a linker error.

Or for example if I redefine a function:

void doSomethingElse()


void doSomethingElse()

P.S. What language do you speak? Maybe somebody on the forum may know a good C++ book in your language.

#5198632 C++ | DirectX | Class system ?!

Posted by on 16 December 2014 - 04:25 PM

and my "problem" is C++.


    And that's why I said you should work on your C++. Most of the questions you ask, you wouldn't need to ask if you had read a semi-decent book on C++. I highly recommend C++ primer 5th ed (not to be confused with primer plus). If you feel it's too hard, I'd recommend Sams teach yourself C++ in 24 hours. You could of course check this topic - http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list and decide what's best for yourself. I'll emphasize the fact that your issues stem not from DirectX's COM objects, but rather from your lack of a better knowledge of C++ (at least that's what your questions lead me to believe). While Java and C++ have some things in common, they are plenty different, so you should really study the language with dedication. I cannot imagine anybody making a decent 3d renderer/engine in C++ without actually having an idea of various design patters, class authoring concerns, paradigms etc. even less when he lacks understanding of the basics of the language (constructors and pointers are considered basics).

    On a side note, I guess people would eventually get pissed at your comments, because they expect "actual questions" - not a step by step guide how to make every single detail work for your implementation. The general idea is that you should put in more effort before asking questions - as in learn the language - or at least the basics. There would be no use if the community writes your whole code for you. I like to regard gamedev as a place that can give you a basic idea where to go from a certain point, if you get stuck, or provide you with additional reading material (that you may or may not be aware of), or give you a relatively objective critique of your code, rather than a "tool" that can magically "fix" your code or write it for you.

#5197573 C++ | DirectX | Class system ?!

Posted by on 11 December 2014 - 08:22 AM

It's because I had already a game on my own Java OpenGL engine.


Bad optimization on your part most probably - Java is not actually that bad. On the other hand do not try to optimize things before you have at least the basics down - http://c2.com/cgi/wiki?PrematureOptimization

#5197441 C++ | DirectX | Class system ?!

Posted by on 10 December 2014 - 01:40 PM

I'd advise you make a factory to which you can delegate the creation/deletion of meshes. And you'd probably want only a few functions/methods to be able to create a mesh(example MeshFactory::createCube(), MeshFactory::loadMesh(char* filename), MeshFactory::createSphere(unsigned int segments)).

Basically something like this:

class Mesh
    //various variables go here - the Mesh may have an empty constructor

class MeshFactory
    std::map<ID, Mesh*> m_meshes; //keep track of meshes by id
    //various details
    ID createMeshFromBuffers(const std::vector<Vertex>& vertexBuffer, const std::vector<UINT>& indexBuffer)
         //you'll need the d3d device to create the ID3D11Buffers from the given buffers
    ID createCube()
        //make the vertex and index buffer vectors
        return createMeshFromBuffers(vertexBuffer, indexBuffer);

You could choose a different architecture of course, there are plenty of books out there that use various architectures when it comes to a 3d renderer.



I have not much experience wiht C++.

Well I'd advise you get some experience with C++ before going into 3d. I don't believe it's a good idea to be studying 3d rendering in C++ if you don't know well enough the language. Rastertek has some pretty good tutorials, other things would be Frank Luna's book, Jason Zink's book, Jason Gregory's book, but as I said - before you delve into 3d with C++ and direct3d you might want to take some time to study C++.

#5197402 C++ | DirectX | Class system ?!

Posted by on 10 December 2014 - 10:40 AM

I like the idea of making some sort of a buffer for the final data.


Lest you want to do some optimizations, for now don't do only one buffer. Later you could do it (then you'll just add an offset per index buffer), but as a beginning try with a buffer per mesh. Basically try to go from simple to hard - make the simpler code work, then you could try optimizing it.

#5197121 Want to become a Computer Scientist

Posted by on 09 December 2014 - 03:44 AM

Since you said you are on your second C++ book, I'd recommend you pick a "good" book if you haven't already done so: http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

#5196916 C++ | DirectX | Class system ?!

Posted by on 08 December 2014 - 03:51 AM

I still don't get what your issue is. What precisely is your issue with COM objects?

Can you elaborate a bit more, rather than just saying "this confusing stuff":

But this didn't worked for C++/ DirectX because of the buffer and this confusing stuff.



In your example you want the laptop to draw itself - that's bad by design, let your renderer draw the laptop. Check the example I gave you - you have some class Mesh containing its vertex & index buffers, its wvp matrix, a pointer to the draw technique it will use etc. Your renderer given this mesh should be able to draw it (the draw(Mesh& mesh) method). You should store all the meshes you have in some structure, and when you want to draw all of them, you can just iterate over this structure and call draw for each of them. To draw a mesh you usually need the d3d device and device context + the mesh's vertex and index buffers - you could store a pointer to the d3d device and device context in the renderer and the model specific data in the mesh; there could be additional data like textures, draw technique, material, render states etc. Here's something you might find useful: http://rastertek.com/tutdx11.html

#5196699 C++ | DirectX | Class system ?!

Posted by on 06 December 2014 - 04:10 PM

I'm not really sure what exactly you are trying to do, but from what I get you just want to have a class encapsulate things. Something like this?:

class Mesh
	ID3D11Buffer* m_vertexBuffer;
	ID3D11Buffer* m_indexBuffer;
	ID3D11EffectTechnique* m_drawTech;

class Renderer
	ID3D11Device* m_d3dDevice;
	ID3D11DeviceContext m_d3dImmediateContext;

	void draw(Mesh& mesh);

class GameApp
	std::vector<Mesh*> m_meshes;
	Renderer renderer;

	void renderWorld();

void GameApp::renderWorld()
	for (auto iter = m_meshes.begin(); iter != m_meshes.end(); iter++)

#5194412 MAKE A CHOICE engines

Posted by on 24 November 2014 - 08:13 AM

There is no engine currently that can work directly with what you call "voxels".





#5194115 MAKE A CHOICE engines

Posted by on 22 November 2014 - 06:18 AM

Can you say what kind of game you want to make? What kind of experience you have in making games? The more info you present concerning your question, the better answers you'll get.