Jump to content

  • Log In with Google      Sign In   
  • Create Account


link102

Member Since 25 Nov 2009
Offline Last Active Jul 30 2014 10:06 AM

Posts I've Made

In Topic: [glsl] converting screen coordinates to view coordinates and back again

04 July 2014 - 12:08 PM

You are changing the range of the depth value

    vec4 position = vec4(texCoord, depth, 1.0);
    // unpack
    position.xyz = position.xyz * 2.0 - 1.0;


It's working now. I used the method (poorly) described here and it magically worked: http://bassser.tumblr.com/post/11626074256/reconstructing-position-from-depth-buffer

I'm still struggling a bit with the names of all the coordinate spaces, but I do know that I wasn't passing the correct coordinate space to the inverse projection matrix. I believe it wants NDC space coordinates and I was passing it screen space so I had to divide by w first or something like that, I'm stil looking into it.

In Topic: Quick question about vertex arrays

30 October 2011 - 02:58 PM

works.

Thank you :)

In Topic: vertex array

30 October 2011 - 02:00 PM

Alternate tutorial for index buffers: http://www.directxtutorial.com/Tutorial9/B-Direct3DBasics/dx9B7.aspx

In Topic: Question about cpp classes and objects

04 June 2011 - 04:36 PM

Something screwed up and removed my reply to your last

I think your WNDCLASSEX strucure should be zero initialised for safety.
Like this right? WNDCLASSEX wcex = {0};
Why should I zero initialise it? the variable is local (right?), it gets destroyed after the class initiator constructor ends.

In dynamic languages it makes more sense because there is no static type checker, nor one definitive place you can go to find the type of a variable. Its a minor stylistic issue, don't sweat it if you prefer it. You might find this an interesting read though.

Makes sence, since the compiler will tell me if I have a type mismatch. It's better to note which kind of variable it is instead of which type.

One thing though. What do you think of this line?

_hInstance = hInstance; (line 12 of windows.h)

In Topic: Question about cpp classes and objects

04 June 2011 - 03:25 PM

Thank you

- Consider using typedef rather than #define for BUTTON though.
Sorted

- Type names are generally written in CamelCase. ALL_CAPS is mostly reserved for constants and preprocessor defines such as include guards.
Sorted, but why are all the win32 types in upper case?

- Many people consider hungarian notation to be pointless and verbose, but that is just a stylistic issue.
It worked fine on all my php projects. I like the hungarian notation because I distinguish variables from definitions better. (visual studio doesn't highlight them)

- You have little or no error checking. Consider exceptions for errors during object construction.
Yea, I am going to do that after I finish this class. I'm planning on making a custom window template for it, since I don't like the standard MessageBox() function.

PARTNERS