1. Post #361
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts
    Would be cool if you would generate a normal map and you could use it for actually physical buttons.
    Good lord, make them steep and self-shadowing, too, for maximum depth'n'jizz.
    Reply With Quote Edit / Delete Thailand Show Events

  2. Post #362
    Gold Member
    Jallen's Avatar
    December 2007
    7,532 Posts
    Would be cool if you would generate a normal map and you could use it for actually physical buttons.
    That would be awesome and probably actually not too difficult.
    Reply With Quote Edit / Delete United States Show Events

  3. Post #363
    Gold Member
    nullsquared's Avatar
    November 2007
    2,450 Posts
    WTF, we're talking about a usable GUI here.

    Edited:



    Well, mouse events seem to be half-working. Still trying to figure out how Qt wants keyboard events :/
    Reply With Quote Edit / Delete United States Show Events

  4. Post #364
    Gold Member
    Siduron's Avatar
    February 2006
    979 Posts
    Working on a lighting shader based on a tutorial.
    Unfortunately the tutorial gives me a flashlight like lighting instead of a 'sun' like light that emits from a position.
    Anyone has any idea?

    Code:
    Code:
    // Lighting
    VS_OUTPUT VS(float3 Pos  : POSITION, float3 Norm : NORMAL, float2 Tex  : TEXCOORD0)
    {
    	VS_OUTPUT Out = (VS_OUTPUT)0;
    	float3 L = -lightDir;
    
        float4x4 WorldView = mul(World, View);
        float3 P = mul(float4(Pos, 1), (float4x3)WorldView);  // position (view space)
    
        float3 N = normalize(mul(Norm, (float3x3)WorldView)); // normal (view space)
    
        float3 R = normalize(2 * dot(N, L) * N - L);          // reflection vector (view space)
        float3 V = -normalize(P);                             // view direction (view space)
    
        Out.Pos  = mul(float4(P, 1), Projection);             // position (projected)
        Out.Diff = I_a * k_a + I_d * k_d * max(0, dot(N, L)); // diffuse + ambient
        Out.Spec = I_s * k_s * pow(max(0, dot(R, V)), n/4);   // specular
        Out.Tex  = Tex;                                       
    
    	return Out;
    }
    Result:
    Reply With Quote Edit / Delete Netherlands Show Events

  5. Post #365
    Gold Member
    nullsquared's Avatar
    November 2007
    2,450 Posts


    Stupid Qt event injection is giving me trouble...
    Reply With Quote Edit / Delete United States Show Events

  6. Post #366
    Gold Member
    PvtCupcakes's Avatar
    May 2008
    10,900 Posts


    Stupid Qt event injection is giving me trouble...
    So basically just putting in a text box doesn't let you type in it? You have to figure out what keys are being pressed and print a character to the screen? The sucks.
    Reply With Quote Edit / Delete United States Show Events

  7. Post #367
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts
    Just a question, though, how's the theming done? I doubt you have access to a theming engine (Qt does that for the Aqua/Luna look (context)), is this a built-in theme?
    Reply With Quote Edit / Delete Thailand Show Events

  8. Post #368
    Gold Member
    nullsquared's Avatar
    November 2007
    2,450 Posts
    So basically just putting in a text box doesn't let you type in it? You have to figure out what keys are being pressed and print a character to the screen? The sucks.
    No.

    Qt wants to be your all-in-one solution. If you want to use Qt as a GUI, Qt will want to be your window manager as well as input manager.

    However, I don't want that. I want to use the Qt GUI as a stand-alone thing, using my own input system/windowing system/etc. Therefore, not only do I need to render Qt to a texture, but I need to inject "fake" events manually (for example, when my input system seems a key press, I need to simulate this for Qt so the text box works).

    Edited:

    Just a question, though, how's the theming done? I doubt you have access to a theming engine (Qt does that for the Aqua/Luna look), is this a built-in theme?
    Qt, by default, renders via whatever theme you're currently using. Here's what happens when I switch to Luna:
    Reply With Quote Edit / Delete United States Show Events

  9. Post #369
    Darkster's Avatar
    July 2009
    182 Posts
    Yes, I'm using Box2D. It's easy to use, fast and it has pretty much all the features of Havok, but in 2D as far as I can tell.

    Now, yesterday I coded sliders and a GUI which can actually do something:


    Here's a link for you to try out.

    Wow that's awesome. Can't wait until it's done. :0
    Reply With Quote Edit / Delete United States Show Events

  10. Post #370
    I am a moderator.
    Swebonny's Avatar
    August 2006
    12,977 Posts
    I'm working on a calculator, currently it's only in console: I'm going to start to adapt a GUI tomorrow.

    http://www.2shared.com/file/6861733/.../EZ-calc.html?

    There's a download if anyone wants to check it out(c/c welcome)

    Here's the source:
    I think you could add some floats in division part.
    Reply With Quote Edit / Delete Sweden Show Events

  11. Post #371
    Gold Member
    noctune9's Avatar
    April 2008
    1,515 Posts
    Working on a lighting shader based on a tutorial.
    Unfortunately the tutorial gives me a flashlight like lighting instead of a 'sun' like light that emits from a position.
    Anyone has any idea?

    Code:
    Code:
    // Lighting
    VS_OUTPUT VS(float3 Pos  : POSITION, float3 Norm : NORMAL, float2 Tex  : TEXCOORD0)
    {
    	VS_OUTPUT Out = (VS_OUTPUT)0;
    	float3 L = -lightDir;
    
        float4x4 WorldView = mul(World, View);
        float3 P = mul(float4(Pos, 1), (float4x3)WorldView);  // position (view space)
    
        float3 N = normalize(mul(Norm, (float3x3)WorldView)); // normal (view space)
    
        float3 R = normalize(2 * dot(N, L) * N - L);          // reflection vector (view space)
        float3 V = -normalize(P);                             // view direction (view space)
    
        Out.Pos  = mul(float4(P, 1), Projection);             // position (projected)
        Out.Diff = I_a * k_a + I_d * k_d * max(0, dot(N, L)); // diffuse + ambient
        Out.Spec = I_s * k_s * pow(max(0, dot(R, V)), n/4);   // specular
        Out.Tex  = Tex;                                       
    
    	return Out;
    }
    Result:
    If you're just going to light terrain, you could do a similar thing to what this guy is doing
    Reply With Quote Edit / Delete Denmark Show Events

  12. Post #372
    Gold Member
    Hazrd24's Avatar
    December 2007
    2,048 Posts
    Wow haha.. Do I know you or did you guess the link?

    EDIT:
    Can you make a gif of the explosion and the woman drowning.

    Here is the link so anyone can play it http://davidjokinen.com/test.php
    2 thumbs up
    Reply With Quote Edit / Delete United States Show Events

  13. Post #373
    Gold Member
    nullsquared's Avatar
    November 2007
    2,450 Posts
    Just a question, though, how's the theming done? I doubt you have access to a theming engine (Qt does that for the Aqua/Luna look (context)), is this a built-in theme?
    Actually it seems I do have access to a theming engine.



    Code:
    qtApp.setStyle(new QPlastiqueStyle);
    Reply With Quote Edit / Delete United States Show Events

  14. Post #374
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts
    Plastique's a theme from KDE.
    Reply With Quote Edit / Delete Thailand Show Events

  15. Post #375
    Gold Member
    nullsquared's Avatar
    November 2007
    2,450 Posts
    Plastique's a theme from KDE.
    Yeah, and Qt is rendering it in my Windows-classic window.
    Reply With Quote Edit / Delete United States Show Events

  16. Post #376
    Gold Member
    TehDoomCat's Avatar
    May 2005
    717 Posts
    I'm working on my own Webcam motion detection program. It tracks coloured markers on the camera input, and I'm going to make it into a server-like program which communicates with local sockets - sending queued events to any connected clients via TCP. I'm planning on doing a GMod client-end for it, meaning I can use real props to do shit in GMod... I like that idea :D

    Right now I'm working on the maths, and figuring out how I can speed it up. Right now it tracks red and blue markers, although it can have some difficulty wirh this when the room is dark or the camera's colour balance is fucked. However, it seems to do the following quite well:
    - Track red and blue markers (but only one of each right now for testing purposes)
    - Measure the distance/size of said markers (closer to the screen/bigger in size means higher 'distance' integer values)
    - Measure the angle between a red & blue marker, if one of each appears on screen - allowing for simple gestures etc. - except the math is fucked for that so it only measures up to 45 degrees in any direction, and right now 'straight up' is not 0/360 degrees.

    I've worked on it a total of about 2 days, so I'm quite pleased with the progress I've made with it. I barely use Python, so to hack up the program I have so far is satisfying.

    I have no screens or sourcecode right now because I'm on holiday, and aren't even working on it right now. Just felt like mentioning it ;p
    Reply With Quote Edit / Delete United Kingdom Show Events

  17. Post #377
    Gold Member
    Klownox's Avatar
    January 2008
    9,709 Posts
    I'm trying to include cross-platform console-clearing in my calculator.

    here's my code:

    #include <iostream>
    #include <cstdlib>
    #include <windows.h>
    
        void clearConsole()
        {
            #ifdef _WIN32
            COORD coordScreen = { 0, 0 };
            DWORD cCharsWritten;
            DWORD dwConSize;
            HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
            CONSOLE_SCREEN_BUFFER_INFO csbi;
    
            GetConsoleScreenBufferInfo(hCon, &csbi);
            dwConSize = csbi.dwSize.X * csbi.dwSize.Y;
    
            FillConsoleOutputCharacterA(hCon, cast(TCHAR)' ', dwConSize, coordScreen, &cCharsWritten);
            GetConsoleScreenBufferInfo(hCon, &csbi);
            FillConsoleOutputAttribute(hCon, csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten);
            SetConsoleCursorPosition(hCon, coordScreen);
            #else
            cout << "\033[2J";
            #endif
        }
    

    Here are the errors:

    Code:
    C:\Documents and Settings\Skeletor\My Documents\EZcalc\clear.h||In function `void clearConsole()':|
    C:\Documents and Settings\Skeletor\My Documents\EZcalc\clear.h|17|error: expected primary-expression before ')' token|
    C:\Documents and Settings\Skeletor\My Documents\EZcalc\clear.h|17|error: `cast' was not declared in this scope|
    C:\Documents and Settings\Skeletor\My Documents\EZcalc\clear.h|17|warning: unused variable 'cast'|
    ||=== Build finished: 2 errors, 1 warnings ===|
    How would I fix this?

    I would like some help from ja_cop, if possible(seeing as he wrote the script)
    Reply With Quote Edit / Delete Canada Show Events

  18. Post #378
    Gold Member
    jA_cOp's Avatar
    May 2006
    2,685 Posts
    Sorry, remove the "cast" on that line. I had originally written the snippet in D, which requires the cast keyword for C style casts. The rest should be compatible.
    Reply With Quote Edit / Delete Norway Show Events

  19. Post #379
    Gold Member
    Klownox's Avatar
    January 2008
    9,709 Posts
    Thanks, it works.
    Reply With Quote Edit / Delete Canada Show Events

  20. Post #380
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    Also you forgot std::cout.
    Reply With Quote Edit / Delete Show Events

  21. Post #381
    Gold Member
    Klownox's Avatar
    January 2008
    9,709 Posts
    ah, good eye gparent.
    Reply With Quote Edit / Delete Canada Show Events

  22. Post #382
    Gold Member
    bigdoggie's Avatar
    June 2007
    1,710 Posts
    Well, after working on web based probramming all this time, I've decided to start on some Win32 programming, working on some kind of STALKER clone, albeit in console, since I'm just getting into C++.

    I got suits working :D

    That's it.
    Reply With Quote Edit / Delete Portugal Show Events

  23. Post #383
    DinCahill's Avatar
    April 2006
    20 Posts
    - Measure the angle between a red & blue marker, if one of each appears on screen - allowing for simple gestures etc. - except the math is fucked for that so it only measures up to 45 degrees in any direction, and right now 'straight up' is not 0/360 degrees.
    Atan2 will give you the angle between (0,0) and a point, so Atan2(x1-x2,y1-y2) will give the angle between the two points between -Pi and Pi radians. Atan2(1,1) and Atan2(-1,1) both return Pi/4 but Atan2(-1,-1) will return (-3/4)Pi. You could modify this output to suit your needs, depending on whether you want the ouput to be from 0 to 2Pi clockwise or the smallest angle regardless of direction or sign. If x is 0, the function will return an error but take the answer as Pi.
    Reply With Quote Edit / Delete United Kingdom Show Events

  24. Post #384

    February 2005
    189 Posts



    My zombie shooter without zombies. But it has guns (and GORE) which you can't really see from the pic.
    Go ahead and play around with what I have so far: Download

    Use WASD to move and mouse to shoot. Press 1 for machine gun, 2 for shotgun.
    Reply With Quote Edit / Delete Show Events

  25. Post #385
    Dennab
    December 2008
    858 Posts
    A simple program that saves My temps from HWmonitor every hour (or what ever interval i set it to)

    It probably exists already, and is easy as hell, but it's a learning experience, and i need it, because my computer has been overheating a bit lately
    Reply With Quote Edit / Delete United States Show Events

  26. Post #386
    Gold Member
    bigdoggie's Avatar
    June 2007
    1,710 Posts
    A simple program that saves My temps from HWmonitor every hour (or what ever interval i set it to)

    It probably exists already, and is easy as hell, but it's a learning experience, and i need it, because my computer has been overheating a bit lately
    How did you capture the values from HWMonitor?
    Reply With Quote Edit / Delete Portugal Show Events

  27. Post #387

    February 2005
    189 Posts
    Randomness

    Reply With Quote Edit / Delete Show Events

  28. Post #388
    Dennab
    December 2008
    858 Posts
    How did you capture the values from HWMonitor?
    It has a built in function that lets you save your temps as a txt

    crtl S

    Edited:

    Randomness

    Did you add the ability to die? because if so, that could be a pretty cool version of geometry wars
    Reply With Quote Edit / Delete United States Show Events

  29. Post #389
    Gold Member
    Benji's Avatar
    December 2006
    7,573 Posts
    A learning experience, something to show what I can do and a fun 2d physics sandbox with multiplayer and scripting possibilities.



    Yes, I'm using Box2D. It's easy to use, fast and it has pretty much all the features of Havok, but in 2D as far as I can tell.

    Now, yesterday I coded sliders and a GUI which can actually do something:



    Here's a link for you to try out.
    "the program can't start because d3dx9_39.dll is missing from your computer. try reinstalling the program to fix this problem"

    googled and couldn't find anywhere to fix this. not gonna download some random .dll What' going on with this?
    Reply With Quote Edit / Delete United States Show Events

  30. Post #390

    February 2005
    189 Posts
    It has a built in function that lets you save your temps as a txt

    crtl S

    Edited:



    Did you add the ability to die? because if so, that could be a pretty cool version of geometry wars
    Not yet, I'm not totally sure how I want the gameplay to be like yet.
    Reply With Quote Edit / Delete Show Events

  31. Post #391
    Dennab
    December 2008
    858 Posts
    Not yet, I'm not totally sure how I want the gameplay to be like yet.
    Well, it's lookin good so far!
    Reply With Quote Edit / Delete United States Show Events

  32. Post #392

    February 2005
    189 Posts
    "the program can't start because d3dx9_39.dll is missing from your computer. try reinstalling the program to fix this problem"

    googled and couldn't find anywhere to fix this. not gonna download some random .dll What' going on with this?
    I think you need the DirectX redist
    Reply With Quote Edit / Delete Show Events

  33. Post #393
    Gold Member
    Xeon06's Avatar
    September 2005
    1,222 Posts



    My zombie shooter without zombies. But it has guns (and GORE) which you can't really see from the pic.
    Go ahead and play around with what I have so far: Download

    Use WASD to move and mouse to shoot. Press 1 for machine gun, 2 for shotgun.
    Crashes for me whenever I start it.
    Reply With Quote Edit / Delete Canada Show Events

  34. Post #394
    Gold Member
    Kylegar's Avatar
    May 2005
    239 Posts
    "the program can't start because d3dx9_39.dll is missing from your computer. try reinstalling the program to fix this problem"

    googled and couldn't find anywhere to fix this. not gonna download some random .dll What' going on with this?
    you need this: http://www.microsoft.com/downloads/d...displaylang=en
    Reply With Quote Edit / Delete United States Show Events

  35. Post #395
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts
    Read the Box2D manual and saw the "create a world and a static box and a dynamic box" tutorial in the manual and turned it into a "click-to-spawn-some-boxes" thing after a few hours of furious classing and copy-pasting into nice class interfaces. The units fucked me hard :(



    I don't think I've learned much from it, really :( - case in point, I still can't figure out how to remove an object from the world. I've tried adding DestroyBody() to the destructor of the "box" class that but makes it keel over and crash, possibly because of how std::vector handles things. I'm reluctant to make it a member function although I know it'll work because I'll end up having to pair it with any location where the destructor is called.
    On the bright side, though, I've got some nice reusable classes that handles initializing the world and a box.
    Reply With Quote Edit / Delete Thailand Show Events

  36. Post #396
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    You destroy bodies with the world.
    Reply With Quote Edit / Delete Netherlands Show Events

  37. Post #397
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts
    Yeah, that's a bit of a problem if I want to clear only *some* objects out - for example, the ground is a "box" class and the boxes are really a vector of "box" class instances, which means if I want to clear out the vector of boxes without dumping the world itself I have to use clear() on the vector as WELL as remove them from the world manually because putting it in the destructor will fritz out.
    Reply With Quote Edit / Delete Thailand Show Events

  38. Post #398

    June 2009
    898 Posts
    Made a texture bank so i don't have to go into 5 different files just to load and unload a texture

    textureBank.h

    enum eTextureID
    {
    	TEXID_UI_WINDOW,
    };
    

    .cpp

    extern const ManagedTextureEntry managedTextureList[] =
    {
    	{ TEXID_UI_WINDOW, "textures\\UI\\messagebox\\box_red.png"},
    };
    

    done!
    Reply With Quote Edit / Delete Anonymous Proxy Show Events

  39. Post #399
    Wickedgenius's Avatar
    November 2007
    407 Posts
    Can anyone suggest a way to have a loop which runs until the q key is pressed without actually waiting for input using curses.

    For example in this code:

    Code:
    while( KEY NOT PRESSED ){
    
    DO STUFF
    
    }
    What needs to go in the KEY NOT PRESSED bit.

    getch() doesn't work as it waits for input.
    Reply With Quote Edit / Delete United Kingdom Show Events

  40. Post #400
    Gold Member
    bigdoggie's Avatar
    June 2007
    1,710 Posts
    Can anyone suggest a way to have a loop which runs until the q key is pressed without actually waiting for input using curses.

    For example in this code:

    Code:
    while( KEY NOT PRESSED ){
    
    DO STUFF
    
    }
    What needs to go in the KEY NOT PRESSED bit.

    getch() doesn't work as it waits for input.
    I'd like to know this too.
    Reply With Quote Edit / Delete Portugal Show Events