Open jppresents opened 9 years ago
Can you try making all height values positive?
Thanks schteppe, that is the solution. I would suggest that the heightfield on construction checks for this and rejects the matrix, if it has negative values.
(I really couldn't make heads or tails of the error I posted here - if it had just said "only positive values" it would have been resolved quickly and without your help.)
You can mark this as resolved (or not - if you want to keep it open until you include the negative value check and error/warning message).
Actually the Heightfield should be able to handle any number input. This is a bug and you confirmed it :) Let's keep it open until resolved.
Thanks! If you find other odd things, don't be afraid to file more issues.
Hi,
I am experimenting with threejs + cannon + blender.
I made a distorted plane in blender for which I calculate the height map and then use cannon to collide balls on this heightmap. (Currently looks like this: http://imgur.com/GokspYg )
I have tried using: the prebuild file from master branch, a self build (grunt) file from master branch and a self build (grunt) file from dev branch, all get these errors when colliding spheres against the heightfield (in the latest chrome):
I get many errors like this in the console log:
Since this spams the console it results in major framerate drops (even if the console is not opened).
Test it here: http://jppresents.net/static/github/cannonHeightfield/index.html code here: http://jppresents.net/static/github/cannonHeightfield/testarea.js (this is really just testing code, so excuse the style and other dirty stuff :) )
(the currently used cannon.js is grunt-build from dev branch)