Jump to content
  • Advertisement

Josheir

Member
  • Content Count

    368
  • Joined

  • Last visited

Community Reputation

478 Neutral

2 Followers

About Josheir

  • Rank
    Member

Personal Information

  • Role
    Amateur / Hobbyist
    Business Development
    Programmer
  • Interests
    Art
    Audio
    Business
    Design
    DevOps
    Education
    Production
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Could some people supply their screen shots demonstrating the best orthogonal examples. I am understanding that the depth does not change the size of the objects. I am wondering if this is a solution for me in a 3D world I am creating. Thanks, Josheir "Keeping it as easy as possible assists in the understanding for those that don't understand it."
  2. Perhaps I use a logical grid for the real mappings? Josheir
  3. I am trying to make a golf putting game where the player rotates around a point where the ball is in a world of triangles. I was going to use a grid to keep track of all the data and possibly keep the angle of the face the same for each of the quads made up of each of the (two) triangles. The problem I did not anticipate is when the player rotates around the point of the ball to putt it, the squares that make up the world are not orthogonal, they are displayed with angular perspective. I am wondering how I would work having more than four 45 degree angles to putt. I would also like the ball to stop at various points in the quadrant where it could be putt again. I am hoping for some good feedback about this idea. Thank you, Josheir
  4. Oh, okay, There are many questions on the internet asking about rotation around a point. I was wondering what the idea is. Say there is a tower in a 3d game, one could use a keypress to rotate around it , perhaps? Thanks, Flucrum.013, Josheir
  5. I'm having a great time with the OpenGL. I have a question though, what sorts of ways can the glm::lookAt command be used in simulators and games. As I am understanding, this command allows us to rotate around a point and look inward. Could I have some real life (diverse) game/simulator descriptions or captured game/simulator images, please? Thank You, Josheir
  6. Alas, there are better ways, and I could really benefit with help with my attempt. Josheir
  7. Here is the code reformatted. If there is even more cleanup to attempt please let me know (exactly) too, this is how I learn! void drawWorld(void) { //using defines int incol = _colus; int depth = _depth; float scaleit = .5; float tempdepth = 0; int startindexat = 0; int counter = 0; int secondcounter = 0; //for (; (tempdepth+1) <= (depth);) //don't forget to change this back! //this is the depth to draw the next two rows of triangles across the screen for (int q=0;q<3;q++) { //odd rows. Draws a row of double triangles across the screen for (int col = 0; (col + 1) <= (incol); col++) { GLfloat matrix1[3][3] = { {(col + 1),0,(tempdepth)},{ (col),0,(tempdepth)}, {(col),0,(tempdepth + 1) } }; //vertex 1 g_vertex_buffer_data_land[startindexat + 0 + counter] = matrix1[0][0] * scaleit; g_vertex_buffer_data_land[startindexat + 1 + counter] = matrix1[0][1] * scaleit; g_vertex_buffer_data_land[startindexat + 2 + counter] = matrix1[0][2] * scaleit; //vertex 2 g_vertex_buffer_data_land[startindexat + 3 + counter] = matrix1[1][0] * scaleit; g_vertex_buffer_data_land[startindexat + 4 + counter] = matrix1[1][1] * scaleit; g_vertex_buffer_data_land[startindexat + 5 + counter] = matrix1[1][2] * scaleit; //vertex3 g_vertex_buffer_data_land[startindexat + 6 + counter] = matrix1[2][0] * scaleit; g_vertex_buffer_data_land[startindexat + 7 + counter] = matrix1[2][1] * scaleit; g_vertex_buffer_data_land[startindexat + 8 + counter] = matrix1[2][2] * scaleit; int matrix2[3][3] = { { (col + 1),0,(tempdepth + 1)},{ (col + 1),0,(tempdepth)}, {(col),0,(tempdepth + 1) } }; g_vertex_buffer_data_land[startindexat + 9 + counter] = matrix2[0][0] * scaleit; g_vertex_buffer_data_land[startindexat + 10 + counter] = matrix2[0][1] * scaleit; g_vertex_buffer_data_land[startindexat + 11 + counter] = matrix2[0][2] * scaleit; g_vertex_buffer_data_land[startindexat + 12 + counter] = matrix2[1][0] * scaleit; g_vertex_buffer_data_land[startindexat + 13 + counter] = matrix2[1][1] * scaleit; g_vertex_buffer_data_land[startindexat + 14 + counter] = matrix2[1][2] * scaleit; g_vertex_buffer_data_land[startindexat + 15 + counter] = matrix2[2][0] * scaleit; g_vertex_buffer_data_land[startindexat + 16 + counter] = matrix2[2][1] * scaleit; g_vertex_buffer_data_land[startindexat + 17 + counter] = matrix2[2][2] * scaleit; counter = counter + 18; } startindexat = 17 + counter+ 1; for (int col2 = 0; (col2+1) <= (incol); col2++) { //first triangle : even rows GLfloat matrix3[3][3] = { {(col2 + 1) ,0,(tempdepth + 2)} , {(col2 + 1),0,(tempdepth + 1)}, {(col2),0,(tempdepth +1)} }; g_vertex_buffer_data_land[(startindexat + secondcounter)] = matrix3[0][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 1 + secondcounter)] = matrix3[0][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 2 + secondcounter)] = matrix3[0][2] * scaleit; g_vertex_buffer_data_land[(startindexat + 3 + secondcounter)] = matrix3[1][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 4 + secondcounter)] = matrix3[1][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 5 + secondcounter)] = matrix3[1][2] * scaleit; g_vertex_buffer_data_land[(startindexat + 6 + secondcounter)] = matrix3[2][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 7 + secondcounter)] = matrix3[2][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 8 + secondcounter)] = matrix3[2][2] * scaleit; //even rows, second triangle int matrix4[3][3] = { {(col2 + 1),0,(tempdepth+ 2)},{ (col2),0,(tempdepth+ 1)}, {(col2),0,(tempdepth + 2) } }; g_vertex_buffer_data_land[(startindexat+9 + secondcounter)] = matrix4[0][0] * scaleit; g_vertex_buffer_data_land[(startindexat+10 + secondcounter)] = matrix4[0][1] * scaleit; g_vertex_buffer_data_land[(startindexat+11 + secondcounter)] = matrix4[0][2] * scaleit; g_vertex_buffer_data_land[(startindexat+12 + secondcounter)] = matrix4[1][0] * scaleit; g_vertex_buffer_data_land[(startindexat+13 + secondcounter)] = matrix4[1][1] * scaleit; g_vertex_buffer_data_land[(startindexat+14 + secondcounter)] = matrix4[1][2] * scaleit; g_vertex_buffer_data_land[(startindexat+15 + secondcounter)] = matrix4[2][0] * scaleit; g_vertex_buffer_data_land[(startindexat+16 + secondcounter)] = matrix4[2][1] * scaleit; g_vertex_buffer_data_land[(startindexat+17 + secondcounter)] = matrix4[2][2] * scaleit; secondcounter = secondcounter + 18; } startindexat = 17 + secondcounter + 1; tempdepth = tempdepth - 1; } } Thank you, Josheir
  8. Sure, I'll repost it later this Sunday. Josheir
  9. I have rewritten this function a few times now and I am having trouble getting every other row to have the triangles face the reverse direction. The image enclosed demonstrates the faulty behavior which includes only one row facing the reversed direction. I am also confused by how many indexes I should have for the g_vertex_buffer_data_land variable, could someone show me a breakdown like : 18 vertices times 2 sets times 8 columns times 8 depth. In another post fleabay mentioned I was not setting a VAO in core profile, however It seems to be. here is the code: float* getVertices(void) { //using defines int incol = _colus; int depth = _depth; int i = 0; float scaleit = .5; float tempdepth = 0; int startindexat = 0; int counter = 0; int secondcounter = 0; //for (; (tempdepth+1) <= (depth);) //don't forget to change this back! for (int q=0;q<3;q++) { //odd rows for (int col = 0; (col+1) <= (incol ); col++) { GLfloat matrix1[3][3] = { {(col + 1),0,(tempdepth)},{ (col),0,(tempdepth)}, {(col),0,(tempdepth + 1) } }; // //vertex 1 g_vertex_buffer_data_land[startindexat + 0 + counter] = matrix1[0][0] * scaleit; g_vertex_buffer_data_land[startindexat + 1 + counter] = matrix1[0][1] * scaleit; g_vertex_buffer_data_land[startindexat + 2 + counter] = matrix1[0][2] * scaleit; //vertex 2 g_vertex_buffer_data_land[startindexat + 3 + counter] = matrix1[1][0] * scaleit; g_vertex_buffer_data_land[startindexat + 4 + counter] = matrix1[1][1] * scaleit; g_vertex_buffer_data_land[startindexat + 5 + counter] = matrix1[1][2] * scaleit; g_vertex_buffer_data_land[startindexat + 6 + counter] = matrix1[2][0] * scaleit; g_vertex_buffer_data_land[startindexat + 7 + counter] = matrix1[2][1] * scaleit; g_vertex_buffer_data_land[startindexat + 8 + counter] = matrix1[2][2] * scaleit; int matrix2[3][3] = { { (col + 1),0,(tempdepth + 1)},{ (col + 1),0,(tempdepth)}, {(col),0,(tempdepth + 1) } }; g_vertex_buffer_data_land[startindexat + 9 + counter] = matrix2[0][0] * scaleit; g_vertex_buffer_data_land[startindexat + 10 + counter] = matrix2[0][1] * scaleit; g_vertex_buffer_data_land[startindexat + 11 + counter] = matrix2[0][2] * scaleit; g_vertex_buffer_data_land[startindexat + 12 + counter] = matrix2[1][0] * scaleit; g_vertex_buffer_data_land[startindexat + 13 + counter] = matrix2[1][1] * scaleit; g_vertex_buffer_data_land[startindexat + 14 + counter] = matrix2[1][2] * scaleit; g_vertex_buffer_data_land[startindexat + 15 + counter] = matrix2[2][0] * scaleit; g_vertex_buffer_data_land[startindexat + 16 + counter] = matrix2[2][1] * scaleit; g_vertex_buffer_data_land[startindexat + 17 + counter] = matrix2[2][2] * scaleit; counter = counter + 18; }//end col startindexat = 17 + counter+ 1; for (int col2 = 0; (col2+1) <= (incol); col2++) { //first triangle : even rows GLfloat matrix3[3][3] = { {(col2 + 1) ,0,(tempdepth + 2)} , {(col2 + 1),0,(tempdepth + 1)}, {(col2),0,(tempdepth +1)} }; // //vertex 1 g_vertex_buffer_data_land[(startindexat + secondcounter)] = matrix3[0][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 1 + secondcounter)] = matrix3[0][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 2 + secondcounter)] = matrix3[0][2] * scaleit; //vertex 2 g_vertex_buffer_data_land[(startindexat + 3 + secondcounter)] = matrix3[1][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 4 + secondcounter)] = matrix3[1][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 5 + secondcounter)] = matrix3[1][2] * scaleit; g_vertex_buffer_data_land[(startindexat + 6 + secondcounter)] = matrix3[2][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 7 + secondcounter)] = matrix3[2][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 8 + secondcounter)] = matrix3[2][2] * scaleit; // even (2) int matrix4[3][3] = { {(col2 + 1),0,(tempdepth+ 2)},{ (col2),0,(tempdepth+ 1)}, {(col2),0,(tempdepth + 2) } }; g_vertex_buffer_data_land[(startindexat+9 + secondcounter)] = matrix4[0][0] * scaleit; g_vertex_buffer_data_land[(startindexat+10 + secondcounter)] = matrix4[0][1] * scaleit; g_vertex_buffer_data_land[(startindexat+11 + secondcounter)] = matrix4[0][2] * scaleit; g_vertex_buffer_data_land[(startindexat+12 + secondcounter)] = matrix4[1][0] * scaleit; g_vertex_buffer_data_land[(startindexat+13 + secondcounter)] = matrix4[1][1] * scaleit; g_vertex_buffer_data_land[(startindexat+14 + secondcounter)] = matrix4[1][2] * scaleit; g_vertex_buffer_data_land[(startindexat+15 + secondcounter)] = matrix4[2][0] * scaleit; g_vertex_buffer_data_land[(startindexat+16 + secondcounter)] = matrix4[2][1] * scaleit; g_vertex_buffer_data_land[(startindexat+17 + secondcounter)] = matrix4[2][2] * scaleit; //one column of 4 triangles //(three vetices per triangle) secondcounter = secondcounter + 18; } startindexat = 17 + secondcounter + 1; tempdepth = tempdepth - 1; } return gvertices; } I am hoping someone might have the experience to help me solve this problem. Or, what could I check and do I need to show more repo code? Thank you, Josheir
  10. fleabay, I think I do have your snippet in my code as VAO1? However, the code is responding weirdly with the new drawing implementation I did. Maybe you could post me a response, Josheir
  11. Thank you for the time-saver concerning the VAO, Josheir
  12. Sorry, yes, build-time error. Thank you for doing as I asked, fleabay. Just what I needed, right? Josheir
  13. This is a follow up to a previous post. MrHallows had asked me to post the project, so I am going to with a new fresh thread so that I can get the most needed help. I have put the class in the main .cpp to simplify for your debugging purposes. My error is : C1189 #error: OpenGL header already included, remove this include, glad already provides it I tried adding : #define GLFW_INCLUDE_NONE, and tried adding this as a preprocessor definitions too. I also tried to change the #ifdef - #endif, except I just couldn't get it working. The code repository URL is : https://github.com/Joshei/GolfProjectRepo/tree/combine_sources/GOLFPROJ The branch is : combine_sources The Commit ID is: a4eaf31 The files involved are : shader_class.cpp, glad.h, glew.h glad1.cpp was also in my project, I removed it to try to solve this problem. Here is the description of the problem at hand: Except for glcolor3f and glRasterPos2i(10,10); the code works without glew.h. When glew is added there is only a runtime error (that is shown above.) I could really use some exact help. You know like, "remove the include for gl.h on lines 50, 65, and 80. Then delete the code at line 80 that states..." I hope that this is not to much to ask for, I really want to win at OpenGL. If I can't get help I could use a much larger file to display the test values or maybe it's possible to write to an open file and view the written data as it's outputted. Thanks in advance, Josheir
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!