Jump to content

Search the Community

Showing results for tags 'selecting'.

  • 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 2 results

  1. My Problem: I want to select a GUI-Element with scene.pickWithRay or would like to be able to use a ray to select a GUI-Element on an object somewhere inside a Scene. Example: Person in VR goes to a Panel inside a game/ scene and wants to interact with it. In a VR-HMD he would be able to select it with his controllers. If he doesn't have controllers a fallback to pick with your head-ray and interact with a press of a button would be nice. If no controllers or buttons (like on simple Cell Phone), fall back to select when holding the ray on the GUI-Element is the plan. Current Solution: public getInteractiveButton (mesh:any) { var button = undefined; // get one of different button types if (mesh) { if (mesh.material.emissiveTexture.getChildren()[0].getChildByName('but0')) { button = mesh.material.emissiveTexture.getChildren()[0].getChildByName('but0') } else if (mesh.material.emissiveTexture.getChildren()[0].getChildByName('but1')) { button = mesh.material.emissiveTexture.getChildren()[0].getChildByName('but1') } else if (mesh.material.emissiveTexture.getChildren()[0].getChildByName('but2')) { button = mesh.material.emissiveTexture.getChildren()[0].getChildByName('but2') } else if (mesh.material.emissiveTexture.getChildren()[0].getChildByName('but3')) { button = mesh.material.emissiveTexture.getChildren()[0].getChildByName('but3') } else if (mesh.material.emissiveTexture.getChildren()[0].getChildByName('but4')) { button = mesh.material.emissiveTexture.getChildren()[0].getChildByName('but4') } else if (mesh.material.emissiveTexture.getChildren()[0].getChildByName(name + '-playbutton')) { button = mesh.material.emissiveTexture.getChildren()[0].getChildByName(name + '-playbutton') } else { console.log('no button'); } } return button; } public vrinteract () { var pickInfo = scene.pickWithRay(Ray); if (pickInfo && pickInfo.hit && pickInfo.pickedMesh.name.includes('uiplane')) { if ((this.vrMouseOverMesh === undefined || this.vrMouseOverMesh === null) || (pickInfo.pickedMesh.uniqueId !== this.vrMouseOverMesh.uniqueId)) { if (this.vrMouseOverMesh) { let button2 = this.getInteractiveButton(this.vrMouseOverMesh); if(button2){ button2.onPointerOutObservable.notifyObservers(); } } let button = this.getInteractiveButton(pickInfo.pickedMesh); if(button){ button.onPointerEnterObservable.notifyObservers(); } this.vrMouseOverMesh = pickInfo.pickedMesh as BABYLON.Mesh; } } else if (this.vrMouseOverMesh) { let button2 = this.getInteractiveButton(this.vrMouseOverMesh); if(button2){ button2.onPointerOutObservable.notifyObservers(); } this.vrMouseOverMesh = null; } else { console.log('no but'); } } What I would Like to know is, if there would be a better option.
  2. Hi! I'm completely a newbie in 3D world and BabylonJs. What I'd like to do is to be able to select a given mesh by clicking on it and change it's color to show that it has been selected. I've created a really basic scene with 2 meshes and googled my problem but couldn't find anything about that. Maybe it's super trivial (?) Here's my example, thanks for any help or any useful resource to get started on this task https://playground.babylonjs.com/#TC2K69
×
×
  • Create New...