Welcome to Phrogram Sign in | Join | Help
in Search


winter/spring contest entry: Math2D

Last post 04-26-2008, 1:28 PM by The Dragon Rider. 13 replies.
Sort Posts: Previous Next
  •  04-06-2008, 11:32 AM 6474

    winter/spring contest entry: Math2D

    Attachment: Math2d.zip

    Created a demo of using 2D math. I'm working on the Model2d class for some time. If you have a closer look to the demo you will see that every model has a shaddow and is lighted ( the color changes depending on how far away it is from the center of the screen ).  The code is not documented by now. Sorry for that.

    Have fun

    Michael

  •  04-06-2008, 11:56 AM 6475 in reply to 6474

    Re: winter/spring contest entry: Math2D

    That is really cool michael....yep noticed the effects and shadows and stuff  you did straight away and in awe! This is exactly the sort of thing that I wish to inspire to do...wow...lots to take in...best of luck also!
    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  04-06-2008, 1:47 PM 6476 in reply to 6474

    Re: winter/spring contest entry: Math2D

    I'm interested in how fast youre computer is. So , if you like, tell me youre fps that in the statusbar. My computer is about 59 fps

    Thanks

    Michael

  •  04-06-2008, 3:22 PM 6482 in reply to 6476

    Re: winter/spring contest entry: Math2D

    It goes around 24/25 fps...think my machine is getting pretty old these days!
    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  04-06-2008, 3:49 PM 6485 in reply to 6476

    Re: winter/spring contest entry: Math2D

    I get 51/52 fps.
  •  04-06-2008, 4:28 PM 6488 in reply to 6485

    Re: winter/spring contest entry: Math2D

    47fps Vista 64 bit, 2.4GHz Quad Core, 4Gb RAM, GeForce 8800 GTX

    I'm fascinated that it doesn't run faster - in fact on my machine the CPU barely goes over 25%. Really makes me think that there are place in Phrogram I can really optimise when I get the time.


    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  04-07-2008, 11:39 AM 6498 in reply to 6488

    Re: winter/spring contest entry: Math2D

    That's interesting ZMann.

    59fps Vista 32 bit, 2.4GHz Core2Quad, 2Gb RAM, GeForce 8400 GS

    The Graficcard dosn't matter I think, unless the Sprite and Drawing classes using DirectXGraphics. Good for older computer.

    For statistics: Everytime the screen is updated there is one call to ClearRGB(). There are 576 points to calculate and 444 lines to draw. ( The backgroundraster is a Model2D to ! )

    I asked for the fps to see what is possible to do so that "every" computer can handle that.

    Thanks so far

    Michael

  •  04-07-2008, 1:18 PM 6500 in reply to 6498

    Re: winter/spring contest entry: Math2D

    Attachment: Math2dstats.zip

    Attached a version with statistics. You have to enter the number of Model2D on the screen.

    Michael

  •  04-07-2008, 1:35 PM 6501 in reply to 6500

    Re: winter/spring contest entry: Math2D

    ok with this spec;

    AMD Athlon XP 2800+ / 2.08 GHz
    NVIDIA GeForce FX 5200
    XP
    512 Memory

    and maximum permissable of 256 objects....computer slows to shudder the graphics along...down to 2/3 fps....


    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  04-07-2008, 1:41 PM 6502 in reply to 6501

    Re: winter/spring contest entry: Math2D

    Quick sub-question here to ask and learn something here....MichaelH your program got it spot on at 24fps originally for my machine  - and I think that is enough for the human eye in films to make everything look smooth...so assume that is the same in the computer gaming world?
    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  04-07-2008, 1:53 PM 6504 in reply to 6498

    Re: winter/spring contest entry: Math2D

    MichaelH:

    The Graficcard dosn't matter I think, unless the Sprite and Drawing classes using DirectXGraphics. Good for older computer.

    It used to be that GDI graphics (what we use for 2d Phrogram) were accelerated using the GPU. However in Vista they moved it all to the CPU - mainly becuase for this type of drawing modern CPUs are just as good. SPUs these days are optimised for very different tasks.

    However this SHOULD mean that Phrogram would sit in a tight loop and max out at least one of the cores on my GPU (Phrogram is barely multi threaded - just for some input stuff) but it isn't. So its waiting on something - probably deep in the core architecture of Phrogram where I dare not tread ;-)

     


    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  04-07-2008, 1:57 PM 6505 in reply to 6502

    Re: winter/spring contest entry: Math2D

    TomDad:
    Quick sub-question here to ask and learn something here....MichaelH your program got it spot on at 24fps originally for my machine  - and I think that is enough for the human eye in films to make everything look smooth...so assume that is the same in the computer gaming world?

    In TV and movies frames may only be shown for 1/25th of a second but that frame contains information about movement such as motion blur becuase it is generated from the entire 1/25th of a second film exposure. So you can get away with that speed. Most gamers will spot anything under 60fps and many prefer higher numbers. Under 30fps most people will notice the jumps especially on fast moving objects.

    Remember though that if your monitor refreshes at 60fps there is no visual value in going any faster! Most CRTs can vary in refresh but most LCDs are fixed.

    I say 'no visual value' becuase some shooter type games will run the input and movement simulations faster than they actually draw the information. This means the math calculations are more accurate and the game feels more responsive even if the UI isn't updated as much.

     


    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  04-08-2008, 1:44 PM 6507 in reply to 6505

    Re: winter/spring contest entry: Math2D

    Thanks...I am beginning to see, but guess to be an all round good programmer - it seems you need to know a little about everything, hardware, maths software etc...and then at least you know where to go to find things out!
    TomDad. Tom is my son...and I'm his Dad. So we are TomDad Software.
  •  04-26-2008, 1:28 PM 6584 in reply to 6474

    Re: winter/spring contest entry: Math2D

    This is definitely going on my favorites list. It would make an awesome screensaver...
View as RSS news feed in XML