meshcarver 12 Posted January 4, 2013 Hey all, I'm trying to find an EXACT angle. I have a mesh, and the roof is angled exactly 45' by 45' sloped. It's 2 meters x2 meters and where the sides meet is exactly 45'. Now, when I create a box, then rotate it to 45' xyz, it doesn't match up..? I also tried with numerical increments but nothing seems to hit it DEAD ON..!? Arghhh..! Ideally, I'd like to find an angle as close to 45' as possible as I'm making a lot of modular roof sections, so they need to "jigsaw" together... Does anyone know the magical mathematical formula for this please..? http://www.flickr.com/photos/86890612@N02/8344355987/in/photostream In the ref picture, the roof is highlighted green, and there's two box placement attempts, one at 45' the other at 35', but neither hit the roof angle... :( I hope I've been concise enough..? Thanks for any help..! Marc Share this post Link to post Share on other sites
max power 21 Posted January 4, 2013 If you are using max you can use the align or normal align tools. Share this post Link to post Share on other sites
soldia 1 Posted January 4, 2013 What do you mean by rotating it "45 degree xyz"? Do you rotate it in all three axis step by step or via any function of your programm at the same time? The problem might be a miscalculation due to limited decimal places used for calculation or visualisation. If you plot a line from the top of your roof slope to the lower corner and measure the angle between this and the vertical axis (I assume it is the z axis, but there are no coordinates in your pictures) shall be 54.74 degree. This is the angle for a diagonal of a cube, the basic geometrical body we got here. But to be exact it is the arccos(1/sqrt(3)). If your program calculates with not enough decimal places and the transformations are done step by step the result may be inaccurate at it is. Share this post Link to post Share on other sites
meshcarver 12 Posted January 4, 2013 Hi, I really need to find this angle exactly. It's for modular construction so it's no good to use the align tools. I've already done it by that method, but I do need this accurate figure... :( I have a roof. It's 2x2x2 meters so the diagonals through it are 45' exactly. (Or so they seem..!) When I create an oblong, :25 x :25 x4 meters, then rotate it by 45' on all three axis, shouldn't the resulting angle go from the top left vert of the roof to the bottom right very for example..? This just isn't happening..!? Basically what I thought would be a simple angle calculation isn't... I've never ran into this before..? Share this post Link to post Share on other sites
max power 21 Posted January 4, 2013 Well then the xyz angles would be present in your worldspace transform. In your pics it's hard to tell what your mesh is actually doing, but if it's canted over 45 degrees and then further rotated 45 degrees on another axis to form the bridge of your roof, none of your rotations are going to make any simple sense at all. You can try aligning your object pivot to your object by eyeballing it if your pivot is not aligned to your object... or you can try using a normal align tool with another object to align it to the faces of the angle you're trying to find and then object align the pivot of your model to the new object. At any rate, in 3d space your rotations are measured in xyz rotations. Share this post Link to post Share on other sites
meshcarver 12 Posted January 4, 2013 What I've done (And it's off still), is I create an oblong that I need to rotate to the exact angle. I put the pivot on one of its corners. Then from above I rotate it 45. Upto now, great. Then, I rotate the two ZX 45 so the oblong rotates down along the diagonal line where the roof edges meet. It ends up off by a little bit. I have no idea why..? Share this post Link to post Share on other sites
soldia 1 Posted January 4, 2013 Ok, if you want to know this angle exactly, I already told you: arccos(1/sqrt(3)) and I already gave a hint why the box isn't aligned correctly Share this post Link to post Share on other sites
meshcarver 12 Posted January 4, 2013 (edited) Hi Solida, I have literally no idea what that means mate lol..! ;) What is a arccos(1/sqrt(3)) and a "hint"..? If there's something you know man, don't hint..! Tell me before my brain melts please..! As a suggestion, if I told you the dimensions I'm dealing with here, could you please work it out of me at a push..? No problems if not... Edited January 4, 2013 by meanmachine1 Share this post Link to post Share on other sites
PuFu 4600 Posted January 4, 2013 What I've done (And it's off still), is I create an oblong that I need to rotate to the exact angle.I put the pivot on one of its corners. Then from above I rotate it 45. Upto now, great. Then, I rotate the two ZX 45 so the oblong rotates down along the diagonal line where the roof edges meet. It ends up off by a little bit. I have no idea why..? simple, because the diagonal angle is not at a 45 degree angle. it is at an angle described by the 2 intersecting planes (each at 45 angle). My workflow when modelling sloped roofs (no matter of the inclined angle). (in 3ds max though) Create the roof as simple planes, (make sure the pivot is aligned to world) select the edges and create shapes from them, then using the sweep them. You can create any other sort of beam or oblongs following the same formula. Share this post Link to post Share on other sites
meshcarver 12 Posted January 4, 2013 Cheers PuFu, I've just duplicated the inside of the roof, then cut the relevant pieces from that to fit exact. It's a shame, I would've liked to have hunted down that figure lol..! Out of interest, the figure I get closet is: 35.265' That's for a roof at 45' slope on both sides equal distance from the centre out for all sides... weird but true. I just assumed it would be 45'... Anyway, here's a shot with the piece I had to do in green to show you what I meant- thanks for you help again anyway: http://www.flickr.com/photos/86890612@N02/8346184730/in/photostream Share this post Link to post Share on other sites
soldia 1 Posted January 4, 2013 Hi Solida,I have literally no idea what that means mate lol..! ;) What is a arccos(1/sqrt(3)) and a "hint"..? If there's something you know man, don't hint..! Tell me before my brain melts please..! As a suggestion, if I told you the dimensions I'm dealing with here, could you please work it out of me at a push..? No problems if not... So that is the mathematical formular you are searching for. The angle between the edge of your roof (the one you are trying to attach a box at) and the z-Axis is the arc cosine (Inverse trigonometric function of cosine) of (1/sqrt(3) / "one divided by the square-root of three") if the angles of the roof segments are 45 degrees to their according axis. Look at post #3, I told you the value there converted to degree: 54,74. And the "hint" is meant as a possible root cause which is IMHO a problem of calculation and/or visibility limits of your program. The idea to rotate a line (or one edge of your box) 45° on all axis is correct. But there might be some failures due to those limits. @PuFu: Right, it is not 45 degree between the edge and the vertical axis. But if you rotate a line by 45 degree in 2 axis you got exactly the intersection you mentioned. Share this post Link to post Share on other sites
max power 21 Posted January 4, 2013 Visually, if you take an oblong in an orthographic viewport (x,y) and rotate it 45 degrees on the z axis , then rotate it in the y axis, you will see the angle foreshorten. The angle it appears to be tilted at is now no longer 45 degrees. Share this post Link to post Share on other sites
soldia 1 Posted January 4, 2013 Visually, if you take an oblong in an orthographic viewport (x,y) and rotate it 45 degrees on the z axis , then rotate it in the y axis, you will see the angle foreshorten. The angle it appears to be tilted at is now no longer 45 degrees. That is my point. The steps are correct. But it is obvious that the program somehow is inaccurate in solving this. OR otherwise the box is correct and the roof edge is incorrect. @meanmachine1: I've calculated the angle a bit more accurate: It should be: alpha = 54.73561032 degree or the counterpart (90-alpha) = 35.26438968 degree. If this doesn't fit, then the modell is incorrect somehow Share this post Link to post Share on other sites
max power 21 Posted January 4, 2013 I think he already confirmed it to be 35.265 degrees which seems close enough. Share this post Link to post Share on other sites
meshcarver 12 Posted January 4, 2013 Cheers both of you- appreciated. ;) Aye, so basically to test, I created a box form scratch then rotated it 45' in two axis, the resulting edge angle is indeed not 45'. Either way, my model is now complete so it's on to the good stuff of texturing it..! :D Share this post Link to post Share on other sites
soldia 1 Posted January 4, 2013 btw: Your work looks really promising and nice portfolio Share this post Link to post Share on other sites
PuFu 4600 Posted January 4, 2013 thing is, the corner rafter is gonna have the inclination of the corner line, and not as you have put it there, as a cut of those planes. here is how the structure would most likely look like for such a roof. bear in mind that the horizontal structural elements are below the vertical/inclined ones. http://i.imgur.com/6BlcL.jpg Share this post Link to post Share on other sites
meshcarver 12 Posted January 6, 2013 @Soldia- thanks man, nice of you to say..! @PuFu- Aye man, that's EXACTLY how I've modelled the beams under the roof itself lol... Share this post Link to post Share on other sites