Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi Niko. Can you please point me on how can i change the scale of TCoords.X,TCoords.Y in a meshbuffer? I am doing this but it doesn't work. var SelMesh = SomeMesh.getMesh(); if (SelMesh) { var meshBuffer = SelMesh.GetMeshBuffers(); if (meshBuffer) { for (var j = 0; j < meshBuffer.length; j++) { var BufVertices = meshBuffer[j].Vertices; for (var k = 0; k < BufVertices.length; k++ ) { meshBuffer[j].Vertices[k].TCoords.X = 10; meshBuffer[j].Vertices[k].TCoords.Y = 10; } meshBuffer[j].Mat.Tex1 = engine.getTextureManager().getTexture("Image.jpg", true); } } } Thank's |
||||
|
Scaling is done by multiplying, so your code should probably something like this:
|
||||
|
It doesn't work can you please check it out? And the other post i had about cloning a mesh bug did you checked it? Thank's |
||||
|
Should work, you probably forgot to call update() at the meshbuffer after you finished your modifications? Cloning meshes should be fixed with the next update. |
||||
|
It's not working i called the update() and when i alert(meshBuffer[j].Vertices[k].TCoords.X ) it prints the right number (10) but it doesn't update the scale????? |
||||
|
|