openworld Tutorials

openworld is developed in Flutter and builds upon the developer’s existing Three.js open-world repository, openworldthreejs. It leverages the three_dart package, simplifying the process of converting Three.js code to three_dart.

https://pub.dev/packages/openworld

Examples

// Example of adding skydome to openworld
    var skyGeo = THREE.SphereGeometry(-1000, 32, 15);

    var skyMat = new THREE.ShaderMaterial(SkyShader);

    var sky = THREE.Mesh(skyGeo, skyMat);

    scene.add(sky);

    skyMat.uniforms = {
      'turbidity': {'value': 10.0},
      'reileigh': {'value': 2.0},
      'mieCoefficient': {'value': 0.005},
      'mieDirectionalG': {'value': 0.8},
      'luminance': {'value': 1.0},
      'inclination': {'value': 0},
      'azimuth': {'value': 0},
      'opacity': {'value': 1.0},
      'sunPosition': {'value': THREE.Vector3(0, 100, 0)}
    };

    // Add Sun
    var sunSphere = THREE.Mesh(THREE.SphereGeometry(20000, 16, 8),
        THREE.MeshBasicMaterial({'color': THREE.Color.fromHex(0xffffff)}));
    sunSphere.position.y = -700000;
    sunSphere.visible = true;
    var sunlight = new THREE.SpotLight(0x888888);//ffffff);
    sunlight.intensity = 0.4;
    sunlight.penumbra = 1;
    sunSphere.add(sunlight);

    scene.add(sunSphere);

    // Openworld will change sky depending on time of day
    OPENWORLD.Time.init(sunSphere, skyMat, ambience);

Similar Posts

  • Rive GameKit Tutorials

    River GameKit is a powerful package developed for Flutter, designed to streamline game creation with a focus on high performance. It enables efficient control over the animation loop and interactive manipulation of animations through state machine inputs. Users can access and modify individual elements in the drawing hierarchy, precisely design their game scene, and utilize APIs designed to simplify game development. The underlying Renderer ensures optimal vector drawing, enhancing the overall gaming experience.

  • Flame Tutorials

    Flame Engine is a comprehensive game development package for Flutter, offering a range of solutions to common game development challenges. Its features include a game loop, an object/component system (FCS), effects and particles, collision detection, and gesture and input handling. It also supports the management of images, animations, sprites, and sprite sheets, alongside providing general utilities to simplify the development process.