diyo-games

Members
  • Content count

    89
  • Joined

  • Last visited

About diyo-games

  • Rank
    Advanced Member
  • Birthday 01/02/1984

Contact Methods

  • Website URL
    http://diyo-games.com
  • Twitter
    diyo_games
  • Skype
    [email protected]

Profile Information

  • Gender
    Male
  • Location
    colombia
  • Interests
    developer: graphic, programmer, sound.. ++

Recent Profile Visitors

903 profile views
  1. solved, thanks
  2. solved for me
  3. many thanks, great, unfortunately i can´t share the code, after when publish, i share the final product and code
  4. please, full code..
  5. with device orientation camera, is possible ? how? latest version..
  6. solved

    I understand the optimization, but in my case, I have a samsung galaxy s7, and the image will be pixelated too, how to improve a bit ..?
  7. Hello, I need to work with raycast, I see that in the examples of playground is used the latest version, when moving to the latest version on mobile The image was pixelated, with both cameras (wdevideorientation and free camera), I had to go back to version 2.5, impossible a raycast that start of the camera position and look ahead :(, also put a sight in the center I do not want to use dom elements because they fail in touch events)
  8. aquí, I can not configure remote debug in chrome i tested it in samsung galaxy s7, same problem
  9. many thanks, private project, now i have a problem with sight to ray casting, when VR is activate
  10. same, the problem is joint 3d and 2d canvas, i will use dom elements to GUI, thanks
  11. BABYLON.SetValueAction : trigger error some (or all) in this lines given the conflict designSize: new BABYLON.Size(540, 960), designUseHorizAxis: true, enableInteraction: true, renderScaleFactor: 8,
  12. amolst : code : if(window.innerWidth > window.innerHeight){ //esta horizontal canvas2 = new BABYLON.ScreenSpaceCanvas2D(escena, { id: "ScreenCanvas", designSize: new BABYLON.Size(960, 540), designUseHorizAxis: true, backgroundBorder: "#00F000FF" }); ancho=960; alto=540; }else{ //esta vertical canvas2 = new BABYLON.ScreenSpaceCanvas2D(escena, { id: "ScreenCanvas", designSize: new BABYLON.Size(540, 540), designUseHorizAxis: false, backgroundBorder: "#00F000FF" }); ancho=540; alto=960; } mensaje =new BABYLON.Text2D("Busca un mostro ", { id: "text", marginAlignment: "h: center, v:center", fontName: "12px Arial", }); rect = new BABYLON.Rectangle2D({ id: "mainRect", parent: canvas2, width: 100, height: 100, fill: "#FF0000FF", origin: new BABYLON.Vector2(0, 0), //doesn't change anything marginAlignment: "v: center, h: center", children:[mensaje] }); rect.actionManager = new BABYLON.ActionManager(escena); rect.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickUpTrigger, function (evt) { alert('player clicked'); })); result :
  13. hi, its show this error : Uncaught ReferenceError: SetValueAction is not defined changed to mensaje = new BABYLON.Text2D("Busca un mostro ", { id: "text", marginAlignment: "h: center, v:center", fontName: "12px Arial", }) rect = new BABYLON.Rectangle2D( { parent: canvas2, id: "button2", x: 210, y: 100, width: 100, height: 40, fill: "#4040C0FF", roundRadius: 10, isVisible: true, children: [mensaje] }); rect.actionManager = new BABYLON.ActionManager(escena); rect.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOutTrigger, this, 'visibility', 0.3)); rect.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPointerOverTrigger, this, 'visibility', 1.0)); rect.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickUpTrigger, function (evt) { alert('player clicked'); })); and on over event : Uncaught TypeError: t.isValid is not a function at t._executeCurrent (babylon.js:21) at t.processTrigger (babylon.js:21) at r.n._triggerActionManager (babylon.js:26250) at r.n._bubbleNotifyPrimPointerObserver (babylon.js:26250) at babylon.js:26250 at r.n._updateOverStatus (babylon.js:26250) at r.n._handlePointerEventForInteraction (babylon.js:26250) at e.callback (babylon.js:26250) at e.notifyObservers (babylon.js:2) at HTMLCanvasElement._onPointerMove (babylon.js:11) not over element, above
  14. hi, thanks. i have other problem. function Init(){ if (/Mobi/.test(navigator.userAgent)) {isMobile = true;}else {isMobile = false;} if(isMobile){ if (screenfull.enabled) { //screenfull.request(); } } console.log(canvas.width); console.log(canvas.height); motor = new BABYLON.Engine(canvas, true); escena = new BABYLON.Scene(motor); motor.setEnableOfflineSuport=false; terreno = BABYLON.MeshBuilder.CreateGround("gd", {width: 40, height:40,subdivsions: 40}, escena); crearMateriales(); //caja1 = new BABYLON.Mesh.CreateBox("Bo1x",4.0,escena); escena.clearColo = new BABYLON.Color3.White(); //camaravr = new BABYLON.WebVRFreeCamera("WVR", new BABYLON.Vector3(0, 0.30, 0), escena); camaravr = new BABYLON.VRDeviceOrientationFreeCamera("DevOr_camera", new BABYLON.Vector3(0, 0.5, 0), escena); // This targets the camera to scene origin camaravr.setTarget(new BABYLON.Vector3(0, .30, 300)); // This attaches the camera to the canvas camaravr.attachControl(canvas, true); camara = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 0.30, 0), escena); //camara = new BABYLON.ArcRotateCamera("Camera", 0, 0, 0, new BABYLON.Vector3.Zero(), escena); //camara.setPosition(new BABYLON.Vector3(0,0.3,0)); //camara.setTarget(BABYLON.Vector3.Zero()); if(isMobile){ escena.activeCamera = camaravr; }else{ escena.activeCamera = camara; } camara.attachControl(canvas,true); camara.keysUp.push(87); camara.keysDown.push(83); camara.keysLeft.push(65); camara.keysRight.push(68); //ray = new BABYLON.Ray(camara.globalPosition, camara.getTarget().subtract(camara.globalPosition).normalize(),50); //caja2 = new BABYLON.Mesh.CreateBox("Box2",4.0,escena); mat1= new BABYLON.StandardMaterial("mat1",escena); mat2= new BABYLON.StandardMaterial("mat1",escena); //mat1.diffuseColor = new BABYLON.Color3(.1,.8,.3); //mat1.emmissiveColor = new BABYLON.Color3(1,1,.3); //mat1.specularColor = new BABYLON.Color3(0,1,1); mat1.diffuseTexture = new BABYLON.Texture("tierra.png", escena); mat2.diffuseTexture = new BABYLON.Texture("tex_arbol5.png", escena); //mat1.bumpTexture = new BABYLON.Texture("tierra_normal.jpg", escena); //mat1.wireframe = true; terreno.material = mat1; //caja1.material = mat1; //caja1.material.alpha = 0.2; //caja1.position = new BABYLON.Vector3(0,0,0); luz_punto=new BABYLON.PointLight("Omni0", new BABYLON.Vector3(0, 3, 0), escena); luz_punto.diffuse = new BABYLON.Color3(1, 1, 1); luz_punto.specular = new BABYLON.Color3(0, 0, 0); luz_punto.intensity = 100.0; escena.actionManager = new BABYLON.ActionManager(escena); escena.actionManager.registerAction(new BABYLON.ExecuteCodeAction({trigger:BABYLON.ActionManager.OnKeyUpTrigger, parameter : "t"}, function(){luz_punto.setEnabled(!luz_punto.isEnabled());})); //fin de register action //luz_spot = new BABYLON.SpotLight("luz2", new BABYLON.Vector3(2,10,2),new BABYLON.Vector3(0,-1,0), BABYLON.Tools.ToRadians(45), 0.1, escena); luz_spot = new BABYLON.HemisphericLight("Hemi0", new BABYLON.Vector3(0, 1, 0), escena); luz_spot.diffuse = new BABYLON.Color3(1,.5,1); luz_spot.specular = new BABYLON.Color3(1, 1, 1); luz_spot.intensity =1000; //luz_punto.parent = camara; //plane = BABYLON.MeshBuilder.CreatePlane("plane", {width: 0.5}, escena); if(window.innerWidth > window.innerHeight){ //esta horizontal canvas2 = new BABYLON.ScreenSpaceCanvas2D(escena, { id: "ScreenCanvas", designSize: new BABYLON.Size(960, 540), designUseHorizAxis: true, backgroundBorder: "#00F000FF" }); ancho=960; alto=540; }else{ canvas2 = new BABYLON.ScreenSpaceCanvas2D(escena, { id: "ScreenCanvas", designSize: new BABYLON.Size(540, 960), designUseHorizAxis: true, backgroundBorder: "#00F000FF" }); ancho=540; alto=960; } mensaje = new BABYLON.Text2D("Busca un mostro ", { id: "text", marginAlignment: "h: center, v:center", fontName: "12px Arial", }) rect = new BABYLON.Rectangle2D( { parent: canvas2, id: "button2", x: 210, y: 100, width: 100, height: 40, fill: "#4040C0FF", roundRadius: 10, isVisible: true, children: [mensaje] }); rect.actionManager = new BABYLON.ActionManager(escena); rect.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickUpTrigger, function (evt) { alert('player clicked'); })); escena.onPointerObservable.add(function (evt) { if (evt.pickInfo.hit && evt.pickInfo.pickedMesh !== undefined) { let mesh = evt.pickInfo.pickedMesh console.log('click on:', mesh.name) } }, BABYLON.PointerEventTypes.POINTERDOWN); The click event does not fire on the rectangle, but on the (as shown in the graph) Is that there is no clarity about how a 2d canvas is resized with respect to the user's screen, I think the problem originates there.
  15. I have 2 elements canvas one for babylonjs (3d) and another for the GUI, although the events do not reach the 3d canvas escena.onPointerDown = function (evt) { console.log("click over scene, not succes"); var pickResult = escena.pick(escena.pointerX, escena.pointerY); //console.log(pickResult); if(pickResult.hit){ console.log("click en "+pickResult.pickedMesh.name); mensaje = pickResult.pickedMesh.name; } } window.addEventListener("click",function(evt){ var pickResult = escena.pick(escena.pointerX, escena.pointerY); console.log("click over window"); if(pickResult.hit){ console.log("click en "+pickResult.pickedMesh.name); mensaje = pickResult.pickedMesh.name; } }); mi html : <canvas id="canvas1">hola</canvas> <canvas id="canvasGui" class="c2">hola2</canvas> css #canvas1{ width : 100%; height : 100%; touch-action: none; z-index: 9; } .c2{ /*canvas 2, for GUI*/ position: absolute; top: 0px; left: 0px; width : 100%; height : 100%; touch-action: none; z-index: 99999999; display:block; }