• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

415 Neutral

About rumpfi88

  • Rank
  1. Hello community,   I'm experimenting a bit with vertex arrays, buffers and shaders. Because there was an option in glGenVertexArrays() that i can generate more than 1 vertex array, so i thought why not using 1 vertex array for 1 object, 3 vertex arrays for 3 objects etc.   My plan:   Objects arrays which stores vertexes, normals and colors vertex array object generated with glGenVertexArray() and bound with glBindVertexArray() vertex buffer, normal buffer and color buffer generated, bound and stored with glBufferData() array for transformation matrix shader program to be used (compiled, attached and linked in Renderer) render function which binds vertex array and uses shader program of this object Renderer basic GL (glClearColor()) settings when rendering in window array for viewing and projection matrix vertex and fragment shader compiled shader program attached with vertex and fragment shader render loop which renders Objects Programming everything in one go (like you see in any OpenGL 3.3+ Tutorial) works fine (beautiful cube), but I don't see any objects in the window with the same verteces, normals colors and shaders. Is it possible that I need to bind a vertex array so that i can link a shader program?   lg
  2. Triangle-AABB intersection test

    I'm done with implementation: I have the following informations and comparisions:   # Objects: 4 # Triangles: 34,378 Render method: Raycasting Render size: 640x480   Time without Octree: ca. 8  minutes Time with Octree: 35 seconds (15s for loading and building, 20s for rendering).   And of course, the results look the same ^^. Thx a lot for your advices.
  3. Triangle-AABB intersection test

    it seems the whole algorithm is easier to understand when transforming the triangle so that AABB's center is at zero-point. I go with SAT.
  4. Triangle-AABB intersection test

      I can't just depend on assumptions, a polygon's triangle might miss that way and then I have a big hole in my rendered object. I'd also like like to avoid transformations needed for SAA.       Thx, I can use that as inspiration, but I intend to avoid extern libraries in my framework. It's an educational purpose and it won't help my readers if I use something else.   @MCapousek   Your algorithm seems compact and not as complicated as MathGeoLib's version where they consider existing defines. I'll also use that as inspritation. But when you use 3 points for a triangle, there is no need to add normal and constant as parameters, you can calculate them from these 3 points.   -------------------------   With so many supports I speak my thanks. I can finally accelerate raycasting/raytracing algorithm in my framework
  5. I want to implement octrees where I store a (limited) number of triangles in each octree node. One triangle can exist in multiple nodes.   Before i can add it I need to figure out if the triangle intersects/overlays with the sub cube of the node. It is only necessary that a part of the triangle is inside that cube. Here are my querys I already implemented:   A triangle is (partly) inside an AABB if at least one of the three corner points is inside AABB at least one of the three edges intersects with at least one of six AABB planes Now there is a third possibilty where a triangle intersects with the AABB, and that is if only the surface goes through one of the six planes. I know that 2 intersecting planes can form a line, but then I don't know how this might help me.   Do you have any ideas how to estimate the third possibility?   lg Chris   PS: follow me on my blog where I explain computer graphics in pure C++ (no OpenGL or DirectX) http://computergraphicsguide.blogspot.co.at/
  6. OpenGL One or multiple octrees

    I only analysed Wavefront OBJ/MTL files and partly 3DS Max files.I don't know how vrmesh will help me with that. The purpose of my framework is to do everything with the support of high quality graphic libraries. It shall help students to understand render algorithms.
  7. OpenGL One or multiple octrees

    Ok thx. After implementation I'll add that method in my blog.
  8. OpenGL One or multiple octrees

      You mean an object is within an octree, and that octree is within an octree surrounding the whole scene.   Scene octree consists of object octrees.
  9. Hey guys,   I want to implement octrees in my hard coded raycasting/raytracing algorithm (no OpenGL or DirectX). I'm also able to load Wavefront OBJ files. But with more and more triangle meshes involved rendering takes longer and longer.   I think octrees are a good data structure for storing surfaces. I don't know which form of octrees is better. one octree for the whole rendering scene multiple octrees, one for each object What's your opinion?   PS: Visit my blog where I explain computer graphics Link: http://computergraphicsguide.blogspot.com/
  10. Computer Graphics Guide

    Hi everyone,   I'm writing a blog about computer graphics. I'm finally done with 2D and started with 3D.   Properties: nice graphics about theory and formulas links to different sources link to my repository to run program of topic repository is pure C++ code and a Makefile, no graphic library (like OpenGL or DirectX) included Graphic libraries run too many calculations in the background unseen by programmers or debuggers, that's why I offer my framework for more explanations.   Link: http://computergraphicsguide.blogspot.com/
  11. I/O File new line problem

      It works. I opened a file in binary mode:   std::ofstream os("test.txt", std::ios::binary); os << "\n"; and except for "\r\n" it wrote "\n" on Windows. This means I have to read and write in binary mode and the ciphered file can be read on any OS. Now I don't have to worry about this problem anymore. I forgot that std::ios::in/out opens files in text mode.   PS: My program is in it's final stage. You enter an integer key and the algorithm ciphers it. Only the correct key can decipher it. The only question is what shall happen if you need too many tries for entering the correct key.
  12. I'm working on a program to (en-)cipher files. With some experiments concerning I/O on Windows and Linux (later on Mac OS) I recognized a difference in file length. I heard that Windows uses 2 Bytes "\r\n" for new line while UNIX systems uses just 1 Byte "\n". I fear that my file (en-)ciphering program wouldn't be platform independent. Is there a way to avoid this?   Main problem: Person A uses Windows and cipher a file which he sends this file to Person B who uses UNIX.   lg
  13. I have a class template "Polynomial" which uses coefficients to calculate polynomial equations. With function "eval(const std::map<char,'type'>) it calculates the equation if i.e. x = 3. First I want to figure out if 'x' is defined (using iterators), but my GNU compiler tells me that a typename is missing. Here my code: [CODE] template<class U> U eval(const std::map<char, U>& values) { bool var_match = false; for(std::map<char, U>::iterator it = values.begin(); it != values.end(); it++) { if((*it).first == varname) var_match = true; } if(!var_match) throw "Variable name mismatch"; /* ... */ } [/CODE] Here my attributes of class Polynomial [CODE] template<class T> class Polynomial { private: char varname; std::vector<T> coefficients; /* ... */ }; [/CODE] Compiler-Error (at for(...;...;...) line): error: need ‘typename’ before ‘std::map<char, U>::iterator’ because ‘std::map<char, U>’ is a dependent scope You have any ideas how to deal with it? lg rumpfi88
  14. I'm currently working on my own Yu-Gi-Oh! Game (I know, there are a lot of people AND a big company working on it, but it's perfect practice for me) and I think of a "Send Signal"-System everytime a player summons a monster or activates a spell/trap card. Now the problem is how to generate such a signal handler: [list] [*]Shall I use a static class (all variables and methods are static) which tells each card what has been played/activated? [*]Is <csignal> of any use for this? [*]Shall I generate an instance of signal handler and send its reference to each Card (SignalHandler& sig_handler;)? [/list] Would be happy for any advice from you. LG rumpfi88
  15. thx a lot. If you would also know how to do it on Ubuntu, would you send me an example/link as well?
  • Advertisement