Search the Community
Showing results for tags 'babylonjs google chrome'.
-
Hello guys i'm trying to use Babylonjs with visual studio but when i try to run my code on chrome this just seems empty without anything i'm new whit babylon but i just can't figure out how to do this I have a project already but when i tryied to change to Visual studio things just went wrong i need help. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="SistemaSolar0._1.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="hand.js"></script> <script src="babylon.js"></script> </head> <body> <style> html, body, div, canvas { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden; } </style> <div id="DivConCaracterística"> <canvas id="Modelado3D"></canvas> </div> // Elemento canvas var ElementoCanvas = document.getElementById("Modelado3D"); // Cargar BABYLON 3D en las canvas var Motorbabylon = new BABYLON.Engine(ElementoCanvas, true); var Escenario = new BABYLON.Scene(Motorbabylon); //Cargar la cámara var Camara = new BABYLON.ArcRotateCamera("Camera", 1, 0.8, 10, new BABYLON.Vector3(0, 0, 0), Escenario); // Agregamos la luz var Luz = new BABYLON.PointLight("Omni", new BABYLON.Vector3(0, 0, 10), Escenario); // elemento 3D (esfera) var origin = BABYLON.Mesh.CreateSphere("origin", 10, 1.0, Escenario); // Agregar la cámara al escenario Escenario.activeCamera.attachControl(ElementoCanvas); // Agregamos un render del escenario Motorbabylon.runRenderLoop(function () { Escenario.render(); }); <form id="form1" runat="server"> <div> </div> </form> </body> </html>