3TATUK2

Members
  • Content count

    231
  • Joined

  • Last visited

Community Reputation

714 Good

About 3TATUK2

  • Rank
    Member
  1. shouldn't you be passing something like glGetAttribLocation(shaderProgram,"vNormal") to glEnableVertexAttribArray ?   Also, see exactly which line allows something to be rendered again if commented out, i'm guessing it's the three lines following "NEW below" ?
  2. FBX model load

    Autodesk's FBX SDK: http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=7478532   The Open Asset Import Library might be worth looking at . . . http://assimp.sourceforge.net/   Also, my personal opinion is that if you're building a custom engine from scratch, might as well implement your own model parsing, and using, ie, Wavefront OBJ is a good starting point... Since it's well documented, simple, ASCII, and basically supports anything you'd need to get going.
  3. recursive hierarchical spatial partitioning
  4. OpenGL OpenGL learning methodology

    http://www.arcsynthesis.org/gltut/ http://ogldev.atspace.co.uk/ http://www.opengl-tutorial.org/ http://lazyfoo.net/tutorials/OpenGL/ http://open.gl/ http://antongerdelan.net/opengl/ http://www.mbsoftworks.sk/index.php?page=tutorials&series=1 http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/ http://www.ozone3d.net/tutorials/
  5. OpenGL Render Flash SWF in OpenGL

    take a look at gnash/gameswf, or librsvg
  6. http://www.lighthouse3d.com/tutorials/glsl-tutorial/
  7. OpenGL Check if GLEW already initialized?

    Well, a few things here... First off, I just added an extra glewInit() call after my existing one, and there is no crash or problem whatsoever. Both calls return GLEW_OK and everything works identically.   Furthermore... If you really need this kind of information in your engine - you *should* keep track of it.   Finally, not exactly what you're asking for, as I'm even guessing GLEW doesn't have a flag or way to check whether it's already initialized... But, glewInit() is *supposed* to be called AFTER a GL context is created.   If you're doing it the proper way. Doing it in that order allows it to be crossplatform. So, assuming you're doing it correctly like this, then that mandates that in order for GLEW to be initialized.. there must be an existing GL context. And you can check this by looking at glGetString(GL_VERSION)
  8. You know that glReadPixels just reads what's on the screen already, so what are you actually trying to do? Copy the screen for re-rendering at a later time?   What are you considering "the standard way"?   Modern, you would populate the texture with the pixel data, and render the texture with a shader.. But then again you also wouldn't be using glReadPixels.   So - maybe glDrawPixels?
  9. Mm... my rotatePoint will probably work, assuming the centerpoint is origin (0,0,0), so you can temporarily readjust for that, try something like this maybe.. void rotatePoint( float* x, float* y, float* z, float xRotation, float yRotation, float centerX, float centerY, float centerZ ) { *x -= centerX; *y -= centerY; *z -= centerZ; float sinPitch = sinf( xRotation ); float cosPitch = cosf( xRotation ); float sinYaw = sinf( yRotation ); float cosYaw = cosf( yRotation ); float sinPitch_y = sinPitch * *y; float cosPitch_z = cosPitch * *z; *x = cosYaw * *x + sinYaw * sinPitch_y - sinYaw * cosPitch_z; *y = cosPitch * *y + sinPitch * z; *z = sinYaw * *x + -sinPitch_y * cosYaw + cosYaw * cosPitch_z; *x += centerX; *y += centerY; *z += centerZ; }
  10. Keep in mind, FBO is not core to 2.1 - so *if* you're using pure 2.1+shaders for legacy card support, you might consider not using FBOs. Yes, most modern cards that still use 2.1 also have FBO extension, but not all of them. PBO would be what's needed.
  11. void rotatePoint( float* x, float* y, float* z, float xRotation, float yRotation ) {     float sinPitch = sinf( xRotation );     float cosPitch = cosf( xRotation );     float sinYaw = sinf( yRotation );     float cosYaw = cosf( yRotation );     float sinPitch_y = sinPitch * *y;     float cosPitch_z = cosPitch * *z;     *x = cosYaw * *x + sinYaw * sinPitch_y - sinYaw * cosPitch_z;     *y = cosPitch * *y + sinPitch * z;     *z = sinYaw * *x + -sinPitch_y * cosYaw + cosYaw * cosPitch_z; } // ... float x1, y1, z1, x2, y2, z2, u1, u2, v1, v2, textid; // x1 = ..., y1 = ..., z1 = ... // x2 = ..., y2 = ..., z2 = ... rotatePoint( &x1, &y1, &z1, xRotation1, yRotation1 ); rotatePoint( &x2, &y2, &z2, xRotation2, yRotation2 ); DrawHouse( x1, x2, y1, y2, z1, z2, u1,  u2,  v1, v2, textid ); Rendering and collision systems can be related, but are still different.   What kind of collision system are you using?   It's possible (and I'm guessing probable - partially based on observation of your code) that you could be going about it in a less-than-optimal fashion - meaning, direct vertex manipulation probably shouldn't be necessary.
  12. OpenGL Nehe 37 model

    Google?   http://www.clockworkcoders.com/oglsl/tutorial10.htm http://www.lighthouse3d.com/tutorials/glsl-tutorial/toon-shading/ http://www.sunandblackcat.com/tipFullView.php?l=eng&topicid=15 http://en.wikibooks.org/wiki/GLSL_Programming/Unity/Toon_Shading
  13. OpenGL Nehe 37 model

    It's an arbitrary format using raw flat data...   The file is "loaded" into `polyData` with a simple fread() call, and the layout is specified using primitive structures POLYGON, VERTEX, VECTOR . . .   *Haha*.   Yes, NeHe isn't the greatest. One good way to start with hands-on model loading is implementing a Wavefront OBJ parser, because it's simple. Besides that you might want to look into something like http://assimp.sourceforge.net/   Also:   http://www.arcsynthesis.org/gltut/ http://ogldev.atspace.co.uk/ http://www.opengl-tutorial.org/ http://lazyfoo.net/tutorials/OpenGL/ http://open.gl/ http://antongerdelan.net/opengl/ http://www.mbsoftworks.sk/index.php?page=tutorials&series=1 http://www.rastertek.com/tutgl40.html http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/ http://www.ozone3d.net/tutorials/
  14. I'm pretty sure PNG "supports" having a proper RGB value. Obviously - there is still data there, regardless of whether it's "garbage" or not.   What determines whether it IS "garbage", is the editing application you use.   For example, I just tested with GIMP and it preserves the RGB just fine when you turn something into alpha.   Not sure about photoshop, etc.