Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateGroundFromHeightMap has no effect #517

Open
carolhmj opened this issue Mar 30, 2022 · 5 comments
Open

CreateGroundFromHeightMap has no effect #517

carolhmj opened this issue Mar 30, 2022 · 5 comments
Assignees
Milestone

Comments

@carolhmj
Copy link

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
@SergioRZMasson SergioRZMasson self-assigned this Mar 30, 2022
@CedricGuillemet
Copy link
Contributor

I'm taking a quick look ...

@CedricGuillemet
Copy link
Contributor

CedricGuillemet commented May 10, 2022

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?

@SergioRZMasson
Copy link
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.

@CedricGuillemet
Copy link
Contributor

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

@thomlucc thomlucc modified the milestones: Future, 6.0 Sep 23, 2022
@bghgary bghgary transferred this issue from BabylonJS/BabylonNative Dec 8, 2022
@bghgary
Copy link
Contributor

bghgary commented Dec 8, 2022

Issue supposedly only happens with Babylon React Native

@bghgary bghgary modified the milestones: 6.0, Future Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants