Using Javascript from SpiderBasic
User avatar
T4r4ntul4
 
Posts: 117
Joined: Wed May 21, 2014 1:57 pm
Location: Netherlands

Re: Babylon.js

by T4r4ntul4 Sun May 14, 2017 12:08 pm

This is very nice!
Fred
Site Admin
 
Posts: 1013
Joined: Mon Feb 24, 2014 10:51 am

Re: Babylon.js

by Fred Sun May 14, 2017 3:58 pm

This is very good stuff !
falsam
 
Posts: 253
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: Babylon.js

by falsam Sun May 14, 2017 10:59 pm

Thank you for your support and comments.

■ Here is a new demonstration in which gadgets will be the basis of a user interface (GUI).

-Click with the right mouse button to create some basic meshs.
-Resize the window, the render is automatically resized.
:arrow: http://falsam.com/sbbjs/canvasgui.html

■ New release 0.87 Beta
- Bug fix
-Add example : 15-Gadgets in a canvas rendering.sb
:arrow: https://github.com/falsam/BJS/archive/master.zip

Works with FireFox, Chrome and Edge. Not with IE.
➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
Mood
http://falsam.com

Sorry for my poor english
HPW
 
Posts: 12
Joined: Thu May 04, 2017 4:25 pm

Re: Babylon.js

by HPW Mon May 15, 2017 3:45 pm

Hello,

Indeed very nice, getting better and better.
Spiderbasic and BabylonJs seems to be a powerfull enviroment for 3D-web-apps.

Regards,
Hans-Peter
falsam
 
Posts: 253
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: Babylon.js

by falsam Wed May 17, 2017 11:31 am

Add function CreateTube()

CreateTube(Name.s, Array VectorsArray.NewVector(1), Radius.f, Tessellation = 32, RadiusFunction = #PB_Ignore)

This new feature allows to create tubular shapes by passing in parameter a table of 3D vectors.
- Demo http://falsam.com/sbbjs/tube.html
- Source https://github.com/falsam/BJS/blob/master/01-Tube.sb


It is also possible to pass in parameter a procedure name whose objective is to calculate a new diameter for each of these 3D vectors.
- Demo http://falsam.com/sbbjs/tuberadiusfunction.html
- Source https://github.com/falsam/BJS/blob/mast ... unction.sb

Enjoy ;)
➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
Mood
http://falsam.com

Sorry for my poor english
HPW
 
Posts: 12
Joined: Thu May 04, 2017 4:25 pm

Re: Babylon.js

by HPW Wed May 17, 2017 3:16 pm

Hello,

After downloading latest zip, some Demos throw this error, here 01-Tube.sb :

Code: Select all
[17:11:48] [COMPILER] Line 91: Structure not found: NewVector.

in Babylon.sbi

Regards
Hans-Peter
falsam
 
Posts: 253
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: Babylon.js

by falsam Wed May 17, 2017 3:46 pm

Thanks for your feedback HPW. I have forgotten to upload constant.sbi. Update completed.

I will test the set of examples with the package located on Github.
➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
Mood
http://falsam.com

Sorry for my poor english
jamirokwai
 
Posts: 33
Joined: Fri Sep 25, 2015 12:00 pm

Re: Babylon.js

by jamirokwai Tue May 23, 2017 8:51 am

Wow. Nice!

Do you think, you could add the Cardboard, and other VR-things to the Camera-functions?
That would be a great addition :-)
falsam
 
Posts: 253
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: Babylon.js

by falsam Tue May 23, 2017 10:54 pm

Do you think, you could add the Cardboard, and other VR-things to the Camera-functions?
Why not. This is possible.

■ This minimum code is experimental. I need testers.

Huawei P9 Android 7.0
- Android and Opera => Works
- Android and Chrome => Does not work

:arrow: Demo with your mobile : http://falsam.com/sbbjs/vrcamera.html

■ Code example
Code: Select all
;Babylon.sbi - VR Camera (Experimental)

EnableExplicit

IncludeFile "babylon/babylon.sbi"

Global Scene, Camera, Light, RedMat, RedBox, BlueMat, BlueBox

Declare LoadGame()
Declare RenderGame()

UseModule BJS

InitEngine(@LoadGame())

Procedure LoadGame()   
  Scene = CreateScene()
 
  If Scene
   
    ;This creates and positions a device orientation camera  (0, 0, 0)
    Camera = CreateCamera("VR Cam", 0, 0, 0, #VR)
   
    ;This targets the camera to scene origin
    CameraLookAt(Camera, 0, 0, 0)
   
    ;Light
    Light = CreateLight("light", 0, 1, 0, 1)
   
    ;Red Box
    RedMat = CreateMaterial("Red Color", "")
    SetMaterialColor(RedMat, #Diffuse, RGB(255, 0, 0))
   
    RedBox = CreateBox("box", 5)
    SetMaterial(RedBox, RedMat)
   
    MoveMesh(RedBox, 0, 0, 10)
   
    ;Create Blue Box
    BlueMat = CreateMaterial("blue color", "")
    SetMaterialColor(BlueMat, #Diffuse, RGB(0, 0, 255))
   
    BlueBox = CreateBox("blue box", 5)
    SetMaterial(BlueBox, BlueMat)
   
    MoveMesh(BlueBox, 0, 0, -10)
   
    RenderLoop(@RenderGame())
  EndIf
EndProcedure

Procedure RenderGame()
  RenderWorld()
EndProcedure
➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
Mood
http://falsam.com

Sorry for my poor english
falsam
 
Posts: 253
Joined: Mon May 05, 2014 9:49 pm
Location: France

Re: Babylon.js

by falsam Tue May 23, 2017 11:42 pm

Babylon.sbi 0.91 is done
- Bug fix.
- Add Virtual Camera.

■ Download https://github.com/falsam/BJS
➽ Windows 10 - JDK 1.8 - SB 2.20 - Android 5.5
Mood
http://falsam.com

Sorry for my poor english
Return to Javascript

Who is online

Users browsing this forum: No registered users and 2 guests