Jump to content

Search the Community

Showing results for tags 'Box rotation'.

  • 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. Hello, I am learning babylon, very powerful , thank you to the creators! But my mathematical skill is not on top for 3d, so I meet some "problems", is there any gentle "mathematical " soul who could help me? So let's go for the problem presentation... I have my camera eyes at x0,y0,z0 looking at a point x1,y1,z1, a few boxes at x2, y2, z2 / x3,y3,z3 / and so on... I wish two possibilities for my boxes All the same faces (possibilities to choose the face of the box) must be perpendicular to the line (x0,y0,z0 / x1,y1,z1) when x0,y0,z0 change (the position of the cam), so a rotation must be applied to each box in (x, y, z) to answer to the demand, what shoud be the values in box.rotation.x, box.rotation.y, box.rotation.z, how to calculate them in relation with x0,y0,z0/ x1,y1,z1/ xn, yn, zn (the coordinates of a box)? All the same faces (possibilities to choose the face of the box) must be perpendicular to the line (x0,y0,z0 / xn,yn,zn (position of the box)) when x0,y0,z0 change (the position of the cam), so a rotation must be applied to each box in (x, y, z) to answer to the demand, what shoud be the values in box.rotation.x, box.rotation.y,box.rotation.z,... How to calculate them in relation with x0,y0,z0/ xn, yn, zn (the coordinates of a box)... (it shoud be like every choosen face of the boxes look at me when I (the cam) move in space - big brother is watching you! I would obtain in programming something like that : (TabBoxes is an array of objects where the coordinates and the color of the boxes are stored) for (var i = 0; i = MaxNumberOfBoxes; i++) { var box = BABYLON.Mesh.CreateBox("box"+i, TabBoxes.size, scene); box.position = new BABYLON.Vector3(TabBoxes.x, TabBoxes.y, TabBoxes.z); var BoxMaterial = new BABYLON.StandardMaterial("kosh", scene) BoxMaterial.diffuseTexture = new BABYLON.Texture(TabBoxes.color, scene); box.material = BoxMaterial ; var FaceNumber = 1; // values possible from 1 to 6 var TypeRotation =2; // values possible from 1 to 2 RotateBoxes(i,FaceNumber,TypeRotation,box.position, scene); }; where... var RotateBoxes = function(NumberOfBox, FaceNumber, TypeRotation, BoxPosition, scene) { ...? ...? ...? box.rotation.x; box.rotation.y; box.rotation.z; } So just to know how to calculate the value of x,y,z... any idea? Sorry for my english, it is not my birth language, I speak french, I just hope to have been enough clear in my explanations. So if a skilly mathematician could help me, I should be forever grateful! Thank you in advance! Alan
×
×
  • Create New...