  # m.ali

Members

8

## About m.ali

• Rank
Newbie
1. Can I change the color of the model material programmatically? I mean at runtime?
2. I want a help with a small problem. The problem is How I can load a 3d model into a babylonjs scene. for example: I use blender to open a 3d air conditioner model and then export to babylonjs. Now I have the model as points. I want to load them into a babylonjs scene. I want to be able to position them according to another object in the scene, (for example, a wall). Is there any guidelines? any references? If it is a complicated problem, please guide me to the path I have to follow to solve this problem. Thanks in advance
3. @JohnK Thank you very much. The article you have provided me with helped me a lot. I have plotted the points very well and the result is perfect. Thanks for your time. I appreciate that.
4. I have a problem in plotting points when trying to create WALLS. The problem in dissection : - I have 4 points in XOZ plane That I want them to produce 4 walls, as each 2 points are a line and I want each line to become a wall by computing the other 2 points of the wall. I assume the height of the wall (3 meters, for example). This wall might contain holes later (Doors & Windows). Finally I need an enclosed room. I want to create these walls without importing from blender, I get those points from elsewhere. Here is the steps, I use to solve the problem: 1) I split the array into 4 lines. Each line contains 2 points. 2) I have to compute the 2 other points for each line. and here is the problem. I used the dimension Y which is wrong when using ExtrudedPolygon Object. So I have to work in the same XOZ plane and rotate. Here I face other problems like How to calculate the angle of rotation? plus the way of computing the 2 other points will be through having 2 data : The length of the wall (3 meter for example) and the angle which is also a variable that depends on the slope of our line. Here is a sample of my try: https://www.babylonjs-playground.com/#SF0BN6 You can find that in the last loop, I create a wall but with points that contain a Y dimension, which resulted in corrupted shape, But I hope to avoid the suffering of Computing the other 2 points in the same XOZ plane which enforces me to respect the slope of the line and so on as I illustrated in the second point. If you have any alternative ideas, I welcome that. Thanks in advance.
5. @Samuel Girardin I am very very grateful to you. It helped me. Working like charm my friend. @JohnK Thanks. You have provided me with an alternative working & helpful workaround. I am very thanksful to you both. Goodbye
6. Thanks @Samuel Girardin But it is actually does not work, I tell you why => The code you wrote converts geographic coordinates into screen point coordinates and this results points that when plotting them they look like if the 4 points are the same point. You can examine it yourself. Use this online tool https://technology.cpm.org/general/3dgraph/ to plot the resulted points and watch it yourself. Thanks in advance
7. @max123 Thanks. But It does not work. I have tried it before, and this actually results distortions.
8. Hi, I need help in the following problem: I am working on a GIS solution and my objective is to create an automation system that accepts an array of coordinates (lat\lng) and outputs a maquette. i.e; I am adding a virtual 3d dimension to the array of points (lat\lng). The problem is when plotting the geographic coordinates array, the result looks like a one point because it's geographic and the distance on earth is very small. What I want is a way to plot the geographic coordinates on the world space but outputs a real corresponding 3d geometry. here is the array of lats-lngs: [50.030462313669034, 26.467167212377877], [50.03022756277145, 26.467086619328583], [50.03012167613479, 26.467340955119003], [50.03035641750763, 26.46742153925565], [50.030462313669034, 26.467167212377877] Note that the difference between the first X and the second X is very small that equals => 0.00023 that when plotting it on BABYLON space looks if the first and second point are the same. I have tried a lot of mathematical normalization ways, to fix this but in vain. "my only condition is to preserve the ratio of objects positions". If any mate can help or suggests a solution. I would be very grateful. Thanks in advance.