Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotnet-websharper/threejs
Three.js for WebSharper
https://github.com/dotnet-websharper/threejs
Last synced: 8 days ago
JSON representation
Three.js for WebSharper
- Host: GitHub
- URL: https://github.com/dotnet-websharper/threejs
- Owner: dotnet-websharper
- License: other
- Created: 2018-08-06T16:24:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-26T09:25:49.000Z (7 months ago)
- Last Synced: 2024-08-02T05:09:28.453Z (3 months ago)
- Language: JavaScript
- Homepage: https://websharper.com
- Size: 647 KB
- Stars: 1
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-websharper - ThreeJs - Leading 3D engine based on WebGL. (Libraries / JavaScript library bindings)
README
# three.js
Robust 3D library with low level complexity.
## Hello Cube!
This example shows you, how easily you can make a cube, which rotates over the time.
```fsharp
let renderer = new THREE.CanvasRenderer()renderer.setSize(1280, 720)
renderer.setClearColor(0xffffff)JQuery.Of("body").Append(renderer.DomElement) |> ignore
let scene = new THREE.Scene()
let light = new THREE.DirectionalLight(0xffffff)light.Position.Z <- 5
scene.Add(light)
let cube = new THREE.Mesh(new THREE.BoxGeometry(1, 1, 1), new THREE.MeshNormalMaterial())
scene.Add(cube)
let camera = new THREE.PerspectiveCamera(45., 16./9.)
camera.Position.Z <- 5
scene.Add(camera)
//requestAnimationFrame is currently not part of the WebSharper.
[]
let render frame = X//---
let rec frame () =
renderer.render(scene, camera)cube.Rotation.Y <- cube.Rotation.Y + 0.01
render frame
//---render frame
```