Skip to content

CreateGroundFromHeightMap has no effect #517

Description

@carolhmj

For questions, please use the forum.

Describe the bug
No heightmap is created and no warnings/errors are shown

To Reproduce
Steps to reproduce the behavior:

  1. Use CreateGroundFromHeightMap with any image https://doc.babylonjs.com/divingDeeper/mesh/creation/set/ground_hmap

Expected behavior
A heightmap mesh should be created

Other

  • Platform: Galaxy S21

Activity

  1. CedricGuillemet commented on May 10, 2022

    @CedricGuillemet
    Collaborator

    I'm taking a quick look ...

  2. CedricGuillemet commented on May 10, 2022

    @CedricGuillemet
    Collaborator

    Got it working with this script (win32 and Android)

    var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 90, BABYLON.Vector3.Zero(), scene);
    camera.lowerBetaLimit = 0.1;
    camera.upperBetaLimit = (Math.PI / 2) * 0.9;
    camera.lowerRadiusLimit = 30;
    camera.upperRadiusLimit = 150;
    //camera.attachControl(canvas, true);
    
    var light = new BABYLON.HemisphericLight("dir01", new BABYLON.Vector3(0, 0.3, -1), scene);
    light.intensity = 0.9;
    
    // Ground
    var ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", "https://playground.babylonjs.com/textures/heightMap.png", 100, 100, 100, 0, 10, scene, false);
    var groundMaterial = new BABYLON.StandardMaterial("ground", scene);
    groundMaterial.diffuseTexture = new BABYLON.Texture("https://playground.babylonjs.com/textures/ground.jpg", scene);
    groundMaterial.diffuseTexture.uScale = 6;
    groundMaterial.diffuseTexture.vScale = 6;
    groundMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
    ground.position.y = -2.05;
    ground.material = groundMaterial;
    

    It's copy pasted code from https://playground.babylonjs.com/#CQNGRK#0
    That is being used for validation test.

    IIRC @carolhmj you were using a different image. Can you please upload it somewhere?

  3. SergioRZMasson commented on May 10, 2022

    @SergioRZMasson
    Contributor

    @CedricGuillemet , are you testing on BabylonNative? I was able to get it working on Babylon Native as well but the problem happens when using it on Babylon React Native.

  4. CedricGuillemet commented on May 11, 2022

    @CedricGuillemet
    Collaborator

    Got the exception : "LoadFileError: Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not supported"

  5. modified the milestones: Future, 6.0 on Sep 23, 2022
  6. bghgary commented on Dec 8, 2022

    @bghgary
    Contributor

    Issue supposedly only happens with Babylon React Native

  7. modified the milestones: 6.0, Future on Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions