• Content Count

  • Joined

  • Last visited

About Iwaa-kun

  • Rank

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  1. I think I found something interesting and perfectly working the way I want. To make it work, it was necessary to know 2 methods: BABYLON.Mesh.computeWorldMatrix(force) returns the (right?) Matrix object of the mesh. I tried getPivotMatrix(), getWorldMatrix(), ... but they did not affect the second method. BABYLON.Vector3.TransformCoordinatesToRef(vector3src, matrix, vector3dest) returns the transformed point through the matrix. To find how to do, I had to study the source code of the method BABYLON.VertexData.transform() Anyway, it works for me. http://playground.babylonjs.com/#2EP7UB http://playground.babylonjs.com/#27K5IR
  2. There is also a method BABYLON.Plane.transform(transformation) but whatever I do, it has no effect on the reflection. I have a result when I do not have a rotation because it is easy. It's a little more difficult when there are transformations (scale, translation, rotation). So I looked for a way to get the coordinates of points using the method BABYLON.Mesh.getVerticesData("position"). But this method returns the position of the points before the transformation, which is not great /:
  3. Thank you for the help but I think I picked a bad example with a sphere ^^' I made another playground with a box: http://www.babylonjs-playground.com/#1UETWM#3 Here we see the reflection is distorted on the mirrors that are on the sides. ( For me, should have been more like that: http://www.babylonjs-playground.com/#1UETWM#4 but I can be wrong ) Of course, this is because the parameters of BABYLON.Plane(a, b, c, d) are not good. What I really wanted to know was if there was a way to calculate a, b and c. In fact, the user can rotate the mirrors along the axis he wants in my final application. So I can not predict all combinations for a, b and c without calculating them.
  4. Hi, I have meshes that I dynamically adds on a scene. Among these meshes, there are mirrors. I used this tutorial to make reflections and it works very well: https://github.com/BabylonJS/Babylon.js/wiki/Advanced-Texturing But when I start to rotate my mesh, the reflection does not follow the rotation. How to make the Plane follows the rotation of the mesh? I attached an example of what I have: I have several mirrors and 1 with a- 45degree angle (-0.785 radian). There are no differences in the reflections. Here is the same problem on the playground: http://www.babylonjs-playground.com/#1UETWM The reflection of "plane2" === The reflection of "plane" And "plane2" is a clone of "plane"
  5. There is the full path of your files but in a Windows system. (eg "C:\Users\FDIAZ\Desktop\REVISTA TENDENCIA\marcador3_samsung\Samsung Galaxy s2\megapixels.png") You have to escape backslash with another backslash (eg "C:\\Users\\FDIAZ\\Desktop\\REVISTA TENDENCIA\\marcador3_samsung\\Samsung Galaxy s2\\megapixels.png") I do not think it will work better because it seems that you test without web server. If you test well with a web server then it is better to use relative paths (I think). Have you changed the file by hand? Then, there is also additional commas. This happened to me when I had several textures by material. I think BabylonJS does not support this function.
  6. Ok, I found the solution which was very very stupid ... Misuse method parameters ... Normal texture and dynamic texture. For a normal texture : // Wrong: mesh.material.diffuseTexture = new BABYLON.Texture("./index.png", scene, true, false);mesh.material.diffuseTexture = new BABYLON.Texture("./index.png", scene);For a dynamic texture // Wrong// mesh.material.diffuseTexture = new BABYLON.DynamicTexture("Skin", 1024, scene);// ---// mesh.material.diffuseTexture.update();mesh.material.diffuseTexture = new BABYLON.DynamicTexture("Skin", 1024, scene, true);// ---mesh.material.diffuseTexture.update(true);I feel really stupid, but thank you very much for your help.
  7. How can I do that? Normally, there is no texture and diffuseTexture is undefined. What I wanted to do is to place a dynamic texture on the model and then I draw the character's face dynamically. So I do this: // mesh.material.diffuseTexture is undefined before thatvar skin = new BABYLON.DynamicTexture("Peau", 1024, newScene, true);skin.hasAlpha = true;skin.getContext().fillStyle = '#ff0000';skin.getContext().fillRect(0,0,1024,1024);skin.getContext().drawImage($('img.eye')[0],0,0,120,100,190,690,120,100); // There is an HTML Image Element loadedskin.update(false);mesh.material.diffuseTexture = skin;But I find myself with the same problem: the texture does not take into account the UV and hasAlpha property changes nothing. How do I reload the model after applying the dynamic texture?
  8. Have you applied scale and rotation on your character? (ctrl+a in object mode)
  9. I can not find the property "subMaterials", it is undefined on "scene.meshes[0].material". I think that's for the MultiMaterial class but all my materials are StandardMaterial.
  10. The values ​​are the same unfortunately /': Here I show you what I get : http://captainngm.free.fr/bjstest/ (offline) The first button recreates the texture but uses the same file (the eye is present under the right armpit). The second button reloads a clone of the initial texture. You can turn on your console log to see objects.
  11. Hi, I'm new to BabylonJS and 3D. I created a scene in Blender with a character. It has a single material, UV Map and texture. It works fine in BabylonJS but when I replace the texture with new BABYLON.Texture or new BABYLON.DynamicTexture (in my case), the new texture does not take into account the UV Map. I think I forgot something, but I don't know where to watch. (Sorry for my English ^^')