Jump to content

Search the Community

Showing results for tags 'addrotation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Having had a look at the playgrounds using Jerome's new addRotation I started wondering about line 39 in http://www.babylonjs-playground.com/#1PON40#4 torus.rotation.copyFromFloats(0.0, 0.0, Math.PI / 2); the torus had already been set as vertical so why was it necessary to re-do it. On commenting out this line and running the PG again the wheel wobbles (quite a lot very soon). So I decided it had to do with stopping error accumulation. My next thought was why copyFromFloats and not just use. torus.rotation = new BABYLON.Vector3(0, 0, Math.PI/2); This does work as in http://www.babylonjs-playground.com/#1PON40#9 From advice about something else that Jerome gave me I decided that it had something to do with avoiding constructing new variables and garbage collection. My next thought was would this be avoided if I set a variable to be the vector3 (0, 0, Math.PI/2) and used this each time. So I created var vRot = new BABYLON.Vector3(0, 0, Math.PI/2); and then in the render loop used torus.rotation = vRot; result more extreme wobbling as in http://www.babylonjs-playground.com/#1PON40#10. If you do a console.log(vRot) in the loop its value changes. The simple question is why? What fundamental misunderstanding have I made this time? (Probably something to do with my use of Javascript rather than BJS)
×
×
  • Create New...