Re: Babylon.js
Posted: Wed May 24, 2017 5:10 pm
Experimental test with a camera 360°. Run it on a mobile device (smartphone, tablet, etc ....)
http://falsam.com/sbbjs/camera360.html
http://falsam.com/sbbjs/camera360.html
Both Work on iPhone 6s and embedded Safari, including gyroscope!falsam wrote:Why not. This is possible.Do you think, you could add the Cardboard, and other VR-things to the Camera-functions?
■ This minimum code is experimental. I need testers.
Huawei P9 Android 7.0
- Android and Opera => Works
- Android and Chrome => Does not work
Demo with your mobile : http://falsam.com/sbbjs/vrcamera.html
http://falsam.com/sbbjs/camera360.html
- Create a material without textureT4r4ntul4 wrote:how do i set a color to the loaded obj file?
Code: Select all
;Babylon.js for SpiderBasic : Color an object
EnableExplicit
IncludeFile "babylon/babylon.sbi"
Global Scene, Camera
Declare LoadGame()
Declare RenderGame()
UseModule BJS
InitEngine(@LoadGame())
Procedure OnLoad(Name.s, Mesh)
Protected Material
Select name
Case "MyScene"
;Create a material without texture
Material = CreateMaterial("Red")
;Define diffuse color
SetMaterialColor(Material, #Diffuse, RGB(255, 0, 0))
;Set material to your object
SetMaterial(Mesh, Material)
RenderLoop(@RenderGame())
EndSelect
EndProcedure
Procedure LoadGame()
Scene = CreateScene()
If Scene
;Camera & Light
Camera = CreateCamera("camera", 0, 0, 10, #ArcRotate)
CameraLookAt(Camera, 0, 0, 0)
CreateLight("light", 0, 20, 0, 0.8)
;The importScene function assigns a name to the scene
ImportScene("MyScene", "data/myobj/", "suzane.obj", @OnLoad())
EndIf
EndProcedure
Procedure RenderGame()
RenderWorld()
EndProcedure
Scene/Asset File
FBX, Collada, OBJ/MTL, STL, JPG, PNG, blend, bvh, cfg, 3dc, txp, osgterrain, terrain, jpg, jpeg, step, stp, igs, iges, xbf, brep, csg, fcstd, oca, gcad, shp, pov, png, x, geo, tga, pbm, pgm, pnm, ppm, bw, int, inta, rgb, rgba, sgi, gdal, bmp, gif, dds, exr, ico, pcx, pfm, pict, pix, ac, lws, lwo, 3ds, tif, tiff, hdr, pdf, iv, wrl, wrz, pic, stl, obj, dae, xgl, zgl, ply, lxo, csm, irrmesh, irr, smd, vta, 3d, md5, mdl, md2, md3, pk3, mdc, nff, off, b3d, q3d, q3s, hmp, ndo, mtl, jsfbx, fbx, json, js, txt, text, md, markdown, claramats, clara, claraarchive, zip, 7z, rar, vismatzip, vismat, vrmatzip, vrmat, vrscene, vrscenezip, foyr, onshape, onshapeassembly, scmat