Search Results

Search found 2 results on 1 pages for 'coffeecup'.

Page 1/1 | 1 

  • javascript fixed timestep gameloop with requestanimation frame

    - by coffeecup
    hello i just started to read through several articles, including http://gafferongames.com/game-physics/fix-your-timestep/ ...://gamedev.stackexchange.com/questions/1589/fixed-time-step-vs-variable-time-step/ ...//dewitters.koonsolo.com/gameloop.html ...://nokarma.org/2011/02/02/javascript-game-development-the-game-loop/index.html my understanding of this is that i need the currentTime and the timeStep size and integrate all states to the next state the time which is left is then passed into the render function to do interpolation i tried to implement glenn fiedlers "the final touch", whats troubling me is that each FrameTime is about 15 (ms) and the update loop runs at about 1500 fps which seems a little bit off? heres my code this.t = 0 this.dt = 0.01 this.currTime = new Date().getTime() this.accumulator = 0.0 this.animate() animate: function(){ var newTime = new Date().getTime() , frameTime = newTime - this.currTime , alpha if ( frameTime > 0.25 ) frameTime = 0.25 this.currTime = newTime this.accumulator += frameTime while (this.accumulator >= this.dt ) { this.prev_state = this.curr_state this.update(this.t,this.dt) this.t += this.dt this.accumulator -= this.dt } alpha = this.accumulator / this.dt this.render( this.t, this.dt, alpha) requestAnimationFrame( this.animate ) } also i would like to know, are there differences between glenn fiedlers implementation and the last solution presented here ? gameloop1 gameloop2 [ sorry couldnt post more than 2 links.. ] edit : i looked into it again and adjusted the values this.currTime = new Date().getTime() this.accumulator = 0 this.p_t = 0 this.p_step = 1000/100 this.animate() animate: function(){ var newTime = new Date().getTime() , frameTime = newTime - this.currTime , alpha if(frameTime > 25) frameTime = 25 this.currTime = newTime this.accumulator += frameTime while(this.accumulator >= this.p_step){ // prevstate = currState this.update() this.p_t+=this.p_step this.accumulator -= this.p_step } alpha = this.accumulator / this.p_step this.render(alpha) requestAnimationFrame( this.animate ) now i can set the physics update rate, render runs at 60 fps and physics update at 100 fps, maybe someone could confirm this because its the first time i'm playing around with game development :-)

    Read the article

  • Create / build / generate a web form that can be on my server and has modern looks and could be impl

    - by Luay
    I have a small web site and would like to add a 'contact us' form and a 'feedback' form. i would like the forms to satisfy the following: 1- be modern looking (with beautiful css effects) 2- the form fields are validated properly and 'inline'. What I mean is once a user skips a required field or enters an email address incorrectly some kind of tooltip or icon is displayed to ask him to cerrect the error (as opposed to a message box that appears after the user clicks 'submit') 3- once the submit button is clicked the form contents are emailed to me. 4- the whole thing can be setup by a noob like myself. 5- no ads on the form I have been searching for at least 5 days for a solution but I can't seem to find anything the would satisfy the above 5 conditions. I don't mind paying for a solution as long as it is hosted on my site and it is a one off payment and not a monthly payment. So far my search has lead me to the following: 1 wufoo. The good: the generated forms seem to look okay but not the best there is. The bad: the free service is limited to 100 submissions. ads on the form. it is not hosted on my server. Paid service requires monthly payments 2- emailmeform: almost same as above except the generated form looks old. They do have an offer where you pay only $4 to get the form and set it up on your own site but that doesn't solve the fact that the forms look old. 3- formAssembly: same as above with minor variations (the generated form looks better) 4- formchamp, formthis, kontaktr,... And other similar online services: the same problem. either the form generated looks outdated or require monthly payments or they put ads...they don't satisfy my conditions. 5- coffeecup form builder. a desktop software. The problem is the generated forms look too old and use flash. 6- simfatic. Another software. Much better than coffeecup. almost satisfies my conditions but the forms not as good as I like. 7- many, many php scripts or html templates that look so outdated or fail when tested (probably because they are too old). Seriously guys, how hard is this. At least 90%+ of website contain at least a 'contact us' form. Why aren't there better solutions? if there is I can't seem to find them. In terms of looks I want something similar to this: http://web-kreation.com/articles/lightform-free-ajaxphp-contact-form/ It is called lightform. And this is a perfect example of what I mean by 'inline' validation. the only problem: there is no script to handle sending the mail. Even if I find one, I don't know how to modify it for my needs. So could you please help me out. I really can't search anymore. I reached rock bottom with this issue. I need a complete solution. If nothing exists then at least a: 1- form template (html) that looks nice and can easily be modified 2- a validation script that does 'inline' validation like the example above (or similar to it) and can be easily implemented by a noob like me to work with the html form. 3- a php script that will handle sending the email and can be easily implemented (all three working in harmony). I hope there is a complete solution but am I asking for too much? Pretty please...help...

    Read the article

1