Quantumcat

Members
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

103 Neutral

About Quantumcat

  • Rank
    Newbie
  1. Beginner looking into game making

    You could make a console-based game af   I was just wondering about a simple game. It wouldn't really need physics. Just something really simple. I would still need to learn all that stuff? You could make a simple text-based, console game in Java or C++ after only a few weeks of learning the language. If you want to draw images and have animations you will need to learn OpenGL. If you just want buttons and text fields and things you can learn Visual Basic pretty fast, I learned that in school using the "Sams Teach Yourself Visual Basic in 24 Hours" book which came with a CD that had the API on it. If you want to be serious but get some results quickly I would say learn Visual Basic and make some tic tac toe games and maze games etc, then when you get bored of it learn C++ (which will be a bit faster after mastering Visual Basic) and then learn OpenGL, but if you just want to play around, find some kids' game making software. You can get pretty-looking games that require no programming knowledge to create.
  2. GLM mat4 specifications

    Never mind, I fixed it! It was a stupid mistake! I learned about mat4's with this post though, so that's good I guess :-) This should be a rule taught very firmly to beginners .... look for the stupid mistakes before assuming there is something wrong with the harder-to-understand code. Sort of like, "If you hear hoof-beats, assume horse not zebra"
  3. GLM mat4 specifications

    Thanks, that makes sense. So the values are just repeated, and if you want to use it for colours or textures you can use the name familiar to you instead of x, y, z, w. I suppose you don't have any ideas about my problem?
  4. Beginner looking into game making

    There are probably some kids' game making tools out there but they would be limited. If you want to make a whole, proper game you will need to learn c++ (may take a few months of dedicated practice), then learn OpenGL (a month or two of dedicated practice to draw basic shapes, learn picking, camera controls, etc, then a few months to learn shaders, lighting, textures etc), and if you didn't do linear algebra and physics at university you will need to learn physics and linear algebra which will take a variable amount of time depending on your prior training. Then you will be able to make a very, very basic game. A few years later you can look to make a proper 3D game. But working by yourself and not in a team making that 3D game could take years, even one that's ostensibly simple.
  5. Looking for some guidance.

    You can make a story game, like they used to have on the first computers. By this I mean something like "You enter a cold dungeon and a goblin appears before you. Press S to swing your sword, press T to talk and press R to run away"   You don't need too many skills to do this with console C++ .... all you need is if and while loops, and cin and cout (and some imagination).
  6. What is the best way to keep track of game objects?

    You can make every object be a class, with positions as member variables, and have a vector of these objects. Then when you draw them, loop over them and use their positions. When they move, change their positions. Every object will keep track of its own position.
  7. Is GLM fast enough for games?

    I have no idea what I'm talking about, but I just introduced about 6 lines of GLM to replace 30 lines of code I had, and instead of taking about 6 seconds to start up, now it takes 30+ seconds. This is in the init phase of the game. I tried using it during the game loop and it froze. I didn't wait long enough to see if it ever unfroze so I can't say for sure if the GLM was really slow or if I made a mistake with my code. Also, on my friend's computer there is never a delay no matter what I do (she has a gaming rig) so it could just be I have a crap computer. Hope that helps :-)
  8. GLM mat4 specifications

        This was supposed to be an identity matrix. It hasn't been timesed with anything so it can't be a union with anything can it? Another question, why do vec4s have 12 values when their name would suggest they have 4? What do vec4's do with their remaining 8 values when using them as a position vector?
  9. GLM mat4 specifications

    I am using GLM to do some stuff and a function I wrote doesn't have the effect I intended, so I looked at a matrix while debugging to see what values it had in it. Surprisingly, it contains 4 arrays (vec4's?) of 12 values each! In each array, the values repeat. I am guessing that I should take the first 4 values of each array to be the actual values in the matrix. Do these become the rows? Or the columns? Do I not take the first 4 values?   Thanks!   Edit: While I do want to know the answer to the above I tried a different tack on debugging and I have a new question about the same problem that prompted the above question. Rather than make a new post I will add the question here.   I have objects I wish to calculate the centres of. Because of the way they were written in the Collada file, I need to rotate them -90 degrees on the X axis to make them sit on the ground. I had success by swapping the Y and Z axes, then multiplying the new Z axis by -1, while calculating their centres.   Then I found out about GLM and wrote a function to rotate a vector to replace the bulky code. It did not work. After looking at the points that came out on each way, realised that my old way had been rotating it +90 instead of -90, so tried sending -1* the angle into my function instead. Looked at the points and it gets the same values (approximately --- one value is 0.00097.. instead of 0.0012..) as the old way, except the world is wrong. A little less wrong than before (the floor is only five or so units off in the y and z directions instead of a thin line in the distance) but still wrong.   I just cannot figure out what might be going wrong. Can anyone shed some light on this?   Here is the function that rotates a vector in case it's wrong (I don't think it is). The find centre function is below it, it seems if I post 2 things with code tags, one of them disappears. The "working" and "try sections are the old way/new way respectively. m_Rot.x is always -90 and y and x 0.     vec4 RotateVec (float XAngle, float YAngle, float ZAngle, vec4 Pivot, vec4 P) { //TEST mat4 test = mat4(1.0f); //..Translate to origin mat4 RotationMatrix = translate(test, vec3(-Pivot.x, 0.0f, 0.0f));  RotationMatrix = translate(RotationMatrix, vec3(0.0f, -Pivot.y, 0.0f));  RotationMatrix = translate(RotationMatrix, vec3(0.0f, 0.0f, -Pivot.z));    //..Do rotations RotationMatrix = rotate(RotationMatrix, XAngle, vec3(1,0,0)); RotationMatrix = rotate(RotationMatrix, YAngle, vec3(0,1,0)); RotationMatrix = rotate(RotationMatrix, ZAngle, vec3(0,0,1));   //..Put back RotationMatrix = translate(RotationMatrix, vec3(Pivot.x, 0.0f, 0.0f));  RotationMatrix = translate(RotationMatrix, vec3(0.0f, Pivot.y, 0.0f));  RotationMatrix = translate(RotationMatrix, vec3(0.0f, 0.0f, Pivot.z));   vec4 ResultVec =  P * RotationMatrix;   return ResultVec; }   void ColladaObject::FindRotCentre (vec4 Pivot, float XAngle, float YAngle, float ZAngle, Pos& Max, Pos& Min) { m_pCollada->m_MaterialMap.StartIterator (); while(m_pCollada->m_MaterialMap.Get()->m_Mesh.size () == 0) { m_pCollada->m_MaterialMap.MoveNext (); } //***working? with no random angles /*TPos<int> Axes (X_AXIS, Y_AXIS, Z_AXIS); TPos<float> Angles (XAngle, YAngle, ZAngle); int mult = 1;   if(m_Rot.x == 90 || m_Rot.x == -90) //this section may need tweaking if things end up facing backward or upside down or anything { Axes.y = Z_AXIS; Angles.y = ZAngle; Axes.z = Y_AXIS; Angles.z = YAngle; if(m_Rot.x == -90) { mult = -1; } } if(m_Rot.y == 90 || m_Rot.y == -90) { Axes.x = Z_AXIS; Angles.x = ZAngle; Axes.z = X_AXIS; Angles.z = XAngle; } if(m_Rot.z == 90 || m_Rot.z == -90) { Axes.y = X_AXIS; Angles.y = XAngle; Axes.x = Y_AXIS; Angles.x = YAngle; }*/   vec4 P; //dont comment out this line     /*P.x = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[Axes.x]; P.y = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[Axes.y]; P.z = mult*m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[Axes.z]; P.w = 1;   //P = RotateVec (Angles.x, Angles.y, Angles.z, Pivot, P);*/ //***end working?   //***try P.x = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[0]; P.y = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[1]; P.z = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[2]; P.w = 1;   P = RotateVec (-1*m_Rot.x, -1*m_Rot.y, -1*m_Rot.z, Pivot, P); //P = RotateVec (XAngle, YAngle, ZAngle, Pivot, P); //***end try   float MaxX = P.x; float MinX = P.x; float MaxY = P.y; float MinY = P.y; float MaxZ = P.z; float MinZ = P.z;   while(!m_pCollada->m_MaterialMap.IsEOM ()) { shared_ptr<Material> pMaterial = m_pCollada->m_MaterialMap.Get(); for (int i = 0; i < pMaterial->m_Mesh.size (); i ++) { //***working? /*P.x = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[Axes.x]; P.y = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[Axes.y]; P.z = mult*m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[Axes.z]; P.w = 1;   //P = RotateVec (Angles.x, Angles.y, Angles.z, Pivot, P);*/ //***end working? //***try P.x = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[0]; P.y = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[1]; P.z = m_pCollada->m_MaterialMap.Get()->m_Mesh.at(0).m_Positions[2];   P = RotateVec (-1*m_Rot.x, -1*m_Rot.y, -1*m_Rot.z, Pivot, P); //P = RotateVec (XAngle, YAngle, ZAngle, Pivot, P); //***end try   if(MaxX < P.x) { MaxX = P.x; } else if(MinX > P.x) { MinX = P.x; } if(MaxY < P.y) { MaxY = P.y; } else if(MinY > P.y) { MinY = P.y; } if(MaxZ < P.z) { MaxZ = P.z; } else if(MinZ > P.z) { MinZ = P.z; } } m_pCollada->m_MaterialMap.MoveNext (); }   m_Centre.x = MinX + (MaxX - MinX)/2; m_Centre.y = MinY + (MaxY - MinY)/2; m_Centre.z = MinZ + (MaxZ - MinZ)/2;   Min.x = MinX - m_Centre.x; Max.x = MaxX - m_Centre.x; Min.y = MinY - m_Centre.y; Max.y = MaxY - m_Centre.y; Min.z = MinZ - m_Centre.z; Max.z = MaxZ - m_Centre.z; }