roman_44 Posted April 26, 2016 Share Posted April 26, 2016 Hey Babylon citizens! Hope you are all doing well! I have big scene imported from 3dMAX. I have planes (meshes) in this scene where I dynamically put pictures as textures. And I need to scale my planes (meshes) to fit ratio of the picture before adding picture as a texture. But the problem is this planes are randomly located in scene. So they are just placed in a 3d world with different angles and positions. I did not find a solution in a forum. So basically I have plane (mesh) with height and width and I need to adjust height depends on picture ratio. But just mesh.scaling.x/y/z = ... is not working because this meshes are rotated. Do I need to get vector of left or right edge of my mesh and then apply scaling by this vector? Or is there any other way to achieve my goal? Thanks!!! Quote Link to comment Share on other sites More sharing options...
RaananW Posted April 27, 2016 Share Posted April 27, 2016 Hi Roman, not sure what the problem is, actually... Scaling happens in local coordinates of the mesh. Do you want to scale in global coordinates? Wanna share a playground? maybe with 2-3 (rotated) meshes and an explanation what you expect to achieve? Quote Link to comment Share on other sites More sharing options...
roman_44 Posted April 27, 2016 Author Share Posted April 27, 2016 Oh thanks RaananW - I think that is the answer to my problem - Scaling happens in local coordinates of the mesh. I cannot reproduce this problem on playground - because it is a lot of stuff happening on my angular app in order to get this point. But here what is happening. This is screenshot from my normal picture on this particular mesh. And then when I get this mesh and apply mesh.scaling.x = 2 that will give me something like this: And I was thinking that that is because it scales on Global coordinates. But if its not, that means that something wrong in my code.... Quote Link to comment Share on other sites More sharing options...
roman_44 Posted April 27, 2016 Author Share Posted April 27, 2016 Hey. Problem resolved. The problem was in 3dMax object properties. Local scale value was strange in Max, so we did xform reset and all values got back to 100 (looks like this is default value). Now everything scales fine. Thanks RaananW for the - "Scaling happens in local coordinates of the mesh" GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.