Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 29 Apr 2002
Offline Last Active Today, 12:01 AM

Posts I've Made

In Topic: What is the definition of the position of a bone?

15 September 2014 - 01:20 AM

Generally the bones translation (the translation you store, lerp) is local/relative to the bones parent bone, if there is no parent bone its local = world. You would transform a bones local transform by its parents world transform to create its world transform, and then use the result for skinning.

As for blenders terminology Im not sure, local = tail? maybe? I find the term bone confusing, it implies two end points, when modeling packages tend to view them as transform nodes with an optional parent node. Nothing says you cant have a single bone-node-transform, attach a model to it and animate it.

In Topic: Error when using blitFramebuffer

06 September 2014 - 01:13 AM

Im a little confused with the use of glFramebufferTexture2D to do a blit, unless those two lines are from the fbo setup. glFramebufferTexture2D attaches a texture to a framebuffer attachment point allowing you to render into the texture.


To blit:

glBindFramebuffer(GL_READ_FRAMEBUFFER, srcID)        // read from this buffer

glReadBuffer(GL_COLOR_ATTACHMENT0)                         // specifically this attachment

glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dstID)        // draw/write to this buffer

glDrawBuffer(GL_COLOR_ATTACHMENT0)                          // specifically this attachment

glBlitFramebuffer(...)                                                              // do the blit

glBindFramebuffer(GL_READ_FRAMEBUFFER, 0)              // clear read

glReadBuffer(...)                                                                   // reset read


by calling glFramebufferTexture2D, youre doing attachments and possibly detaching, which is sometimes needed depending on what youre doing, Im just not sure if you need it here.

In Topic: OpenGL texture array difficulties

06 September 2014 - 12:40 AM

glTexParameteri(GL_TEXTURE_2D........ ARRAY?

In Topic: COLLADA vs FBX... Are They Worthwhile for Generic Model Formats?

30 August 2014 - 07:43 PM

That about sums it up. Pretty much the same experience i had with COLLADA. I bounced around forums trying to figure out why this or that would cause a crash or produce a different result between maya and 3ds max. Waiting for exporters to be updated by someone else killed it for me.

I had kept an eye on FBX but with the versions and heavy weight details and extras, I didnt have it in me to get into it after COLLADA. Eventually I figured these problems would never completely go away, so I wrote my own, a sort of tag based binary COLLADA.

I figured the time being wasted fighting and understanding the output from these model packages and file formats would be better spent on something concrete, like an exporter for my own format.

In the end the time was well spent, I have an exporter, I have a file format, I can add sections to it to support future (game specific) ideas, I control how the data is ordered and read in, if it breaks it means the modeling package changed (rare), I can ignore what I dont need during the export (smaller files).

I will say though, If I hadnt gotten pretty deep into COLLADA in the first place, getting the animation data right probably would have been more confusing.

In Topic: OpenGL - glReadPixels returns incorrect values

26 August 2014 - 02:35 PM

Not sure what gl version you are targeting, try

        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, framebuffer);

	unsigned char *pixels = new unsigned char[w *h *3];
	for(unsigned int i=0;i<(w *h *3);i++)
	pixels[i] = 255;

        glBindFramebuffer(GL_READ_FRAMEBUFFER, framebuffer);
	for(unsigned int i=0; i<(w *h *3); i+=3)
		unsigned int r = pixels[i];
		unsigned int g = pixels[i + 1];
		unsigned int b = pixels[i + 2];
		std::cout<<i<<": "<<r<<","<<g<<","<<b<<std::endl;
	delete[] pixels;


	int err = glGetError(); // No error reported