Jump to content

I have error undefined is not a function _computeTextureMatrix()


Dad72
 Share

Recommended Posts

I have replace _computeTextureMatrix() => getTextureMatrix()
 
But the terrain is given a 0. I have more mountain and river... try the WorlMonger 1.12.  I use the material of WorldMonger + StandardMaterial merged:
 
I load my terrian like this:

ground = BABYLON.Mesh.CreateGround("myGround", 500, 500, 200, scene, true);this.meshGround.setVerticesData(BABYLON.VertexBuffer.PositionKind, $.parseJSON(this.savedPosition), true);this.meshGround.setVerticesData(BABYLON.VertexBuffer.NormalKind, $.parseJSON(this.savedNormal), true);this.meshGround.setVerticesData(BABYLON.VertexBuffer.UVKind, $.parseJSON(this.savedUvs));ground.material = new WORLDCASTOR.GroundMaterial("Material_myGround", scene, Light); 

var Position and var Normal ans var savedUvs her recover from a file

Link to comment
Share on other sites

I have :
 
Uncaught TypeError: Cannot set property 'innerHTML' of null
in VM10977:1
 
I have no such file
 
Otherwise I test this: it works,
 

ground = BABYLON.Mesh.CreateGroundFromHeightMap("myGround", "Data/Textures/Terrain/heightMap/heightMapShaderEditor.png", 200, 200, 145, 0, 20, scene, true);ground.material = new WORLDCASTOR.GroundMaterial("Material_myGround", scene, Light);

 
but this, the ground is flat.
 

ground = BABYLON.Mesh.CreateGround("myGround", 500, 500, 200, scene, true);this.meshGround.setVerticesData(BABYLON.VertexBuffer.PositionKind, $.parseJSON(this.savedPosition), true);this.meshGround.setVerticesData(BABYLON.VertexBuffer.NormalKind, $.parseJSON(this.savedNormal), true);this.meshGround.setVerticesData(BABYLON.VertexBuffer.UVKind, $.parseJSON(this.savedUvs));ground.material = new WORLDCASTOR.GroundMaterial("Material_myGround", scene, Light);

may be a because of:  setVerticesData()

Link to comment
Share on other sites

ok. I took exactly the same worldmonger demo, but I change by calling a file 
 

    // Grounds Version Defaut	/*    var ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", "Assets/heightMap.png", 100, 100, 100, 0, 12, scene, true);    var groundMaterial = new WORLDMONGER.GroundMaterial("ground", scene, sun);    ground.material = groundMaterial;    ground.position.y = -2.0;	*/    // Grounds Version modified (Loading has sailed from a file)	var ground;	$.ajaxSetup({ async: false});	$.ajax({ url:"Open_terrain.fonction.php", type:'POST',		success:function(data){								data = data.split(";");			var savedPosition = data[0];			var savedNormal = data[1];			var Mysubdivision = data[2];			var MydimX = data[3];			var MydimY = data[4];							ground = BABYLON.Mesh.CreateGround("ground", parseInt(MydimX), parseInt(MydimY), parseInt(Mysubdivision), scene, true);			ground.setVerticesData($.parseJSON(savedPosition), BABYLON.VertexBuffer.PositionKind, true);			ground.setVerticesData($.parseJSON(savedNormal), BABYLON.VertexBuffer.NormalKind, true);				ground.material = new WORLDMONGER.GroundMaterial("Material_ground", scene, sun);			ground.position.y = -3.0;			ground.isPickable = false;		}	});
Link to comment
Share on other sites

This one is also my fault!!!

 

I'm so sorry about that. This is EXACTLY why I do not want to change a published API

 

Anyway, here is the reason:

 - **Breaking changes**
 - ```Mesh.setVerticesData``` signature is now: (kind, values, updatable) instead of (values, kind, updatable) in order to be consistent with ```Mesh.updateVerticesData```
Link to comment
Share on other sites

Yes. This works. I had read and I forget to change it.

 
There is no of problem DK, be not sorry. you made a really works great on babylon. Your engine is the best one out there for webgl. I have test many of engine and it's yours engine I'm most loyal.  ;)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...