• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

498 Neutral

About kidman171

  • Rank
  1. Basic SFML problem, graphics

    As a side note, you should not be clearing and displaying the window inside the while-loop that you are using to poll events. You should only clear and display once per frame.
  2. help computing positions of points

    SeanMiddleditch,     Your solution works perfectly. Thanks so much!
  3. help computing positions of points

    @Nypyren - Ah I see now. The picture clarifies what you mean. That sounds like it would work as well.   @SeanMiddleditch - Good notes I will keep this in mind.
  4. help computing positions of points

      Not sure I entirely follow. I am going to try to implement SeanMiddleditch's solution tomorrow. Thanks for your response!
  5. help computing positions of points

      I understand exactly what you mean. I thought of D being the center of a circle with radius 2 earlier but I have never worked with tangents before so my thought train ended there. I will try to work out a solution with this tomorrow, it looks like a sound solution. Thanks so much!
  6. help computing positions of points

      I thought it might not be possible but I needed another set of eyes to confirm. Thanks for taking the time to respond.
  7. I've been trying to figure out a solution for this math problem. It might be simple, it might be impossible. I don't know because I am still very inexperienced in this domain.   I will be referring to this drawing:     The Problem: This drawing depicts two rectangles lying on the x-z plane. Think of it like you are looking at them top-down (down the -y axis). The black points (H, I, and J) are given as input. The width of the rectangle is always 4. I need to compute the positions of each green point (A through G).   My Partial Solution: Computing points D through G is easy:  vec3 forward = normalize(I-J); // direction from J to I vec3 right = cross(forward, vec3(0,1,0)); // direction from F to G G = J + (right * 2); // 2 = width/2 F = J - (right * 2); I can use the same formula to compute D and E.   Where I Need Help:   I don't know how to compute A, B or C!  Any help or advice is greatly appreciated!  
  8. Pointers and functions help

    You have to use the string in order to use the getline function. SiCrane's example seems to be the easiest way to solve the problem. As an alternative, you could eat the newline character after the number like this: for (int i = 0; i < size; ++i) { cout << "Name " << i + 1 << ": "; getline(cin, name[i]); cout << "Number " << i + 1 << ": "; cin >> number[i]; char newline = cin.get(); } The only problem with this solution is that if you enter something like a space after the number then the newline does not get eaten.
  9. What's so fun about city builders?

    Hello, big city building fan here. I'm also the creator and webmaster of http://xlnation.net, the largest community for the Cities XL series.   I like city building games because they allow me to be creative. I love fine-tuning my cities' inner workings and to see the complex interaction of a bustling city in full 3D. Cities XL is my favorite city building game because it has nice graphics and I can create beautiful large cities with it. I did not buy the new Sim City because EA really botched the game.   P.S. I am also (very slowly) playing around with my own city building game project. Good luck!
  10. Problems with TransfromFeedback

    If I am not mistaken, you are required to have a vertex array object bound with 4.0 core profile.   I successfully used transform feedback in an experiment to flatten terrain a little while back. Here is the code I used to run the transform feedback portion. : _transformProgram.enable(); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, _transformer); glBindVertexArray(_VAO); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, _yBuffer ); glEnable(GL_RASTERIZER_DISCARD); glBeginTransformFeedback(GL_POINTS); glDrawArrays(GL_POINTS, 0, _vertexCount); glEndTransformFeedback(); glDisable(GL_RASTERIZER_DISCARD); glBindVertexArray(0); glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0); _transformProgram.disable(); My draw call was just a few lines because all the buffers are associated with the VAO: _renderProgram.enable(); _renderProgram.setUniform("ModelViewProjMat", modelViewProjMat); glBindVertexArray(_VAO); glDrawElements(GL_TRIANGLES, _elementCount, GL_UNSIGNED_INT, 0); _renderProgram.disable(); Edit: see this example as well: https://github.com/progschj/OpenGL-Examples/blob/master/09transform_feedback.cpp
  11. OpenGL

    If you don't want to use any libraries like glut or glew, check out rastertek's opengl series (www.rastertek.com). Once you create a window from scratch and you load the opengl function pointers from scratch, you will most likely realize how much time you have wasted and you will go grab yourself a copy of glew :)
  12. SDL C++ Program crashing

    [edit] Alvaro beat me to it.
  13. Coding Style: Curly Braces

    What about using the best of both worlds?   int doSomething(int x) { int y; // ... do complex operation return y; }    
  14. lib3ds

    You can compile makefiles on windows with MinGW32-make. Just check in your mingw installation and see if there is a binary called mingw32-make. If so, open a command prompt, cd to the folder with the makefile in it, and run mingw32-make.
  15. OpenGL Mesh Class

      Just a side note: make sure to clear the depth buffer as well: glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
  • Advertisement