NotAvailable Posted July 21, 2010 Share Posted July 21, 2010 Hi, Im trying to make a safe zone for my server. But everytime i got the wrong coordinates/position So, Can someone explain me how those CollShape coordinates work? here is the line: g_base_col = createColCuboid ( 536.44488525391, -2651.2810058594, 0, 100, 100, 1000 ) Link to comment
MaddDogg Posted July 21, 2010 Share Posted July 21, 2010 colshape createColCuboid ( float fX, float fY, float fZ, float fWidth, float fDepth, float fHeight ) The first point, determined by fX, fY and fZ, is located at the bottom left corner of the cuboid on the ground. The width, depth and height then determine, how far to the right, forward and up the cuboid should go. So, an easy way to create a cuboid is to first go to the bottom left corner of your area. Then save your position and go to the top right corner. Again a save. Now you use the first x,y,z as fX, fY and fZ. Then you calculate the difference between the second x,y and the first x,y and then that's your fWidth and fDepth. Now you just have to set your height (fHeight) of your cuboid. For that you could also save a position one more time, while you're up in the air. EDIT: Just drew something for you. [attachment=0]cuboid.jpg[/attachment] Link to comment
NotAvailable Posted July 21, 2010 Author Share Posted July 21, 2010 colshape createColCuboid ( float fX, float fY, float fZ, float fWidth, float fDepth, float fHeight ) The first point, determined by fX, fY and fZ, is located at the bottom left corner of the cuboid on the ground. The width, depth and height then determine, how far to the right, forward and up the cuboid should go. So, an easy way to create a cuboid is to first go to the bottom left corner of your area. Then save your position and go to the top right corner. Again a save. Now you use the first x,y,z as fX, fY and fZ. Then you calculate the difference between the second x,y and the first x,y and then that's your fWidth and fDepth. Now you just have to set your height (fHeight) of your cuboid. For that you could also save a position one more time, while you're up in the air. EDIT: Just drew something for you. [attachment=0]cuboid.jpg[/attachment] k thanks Link to comment
NotAvailable Posted July 21, 2010 Author Share Posted July 21, 2010 colshape createColCuboid ( float fX, float fY, float fZ, float fWidth, float fDepth, float fHeight ) The first point, determined by fX, fY and fZ, is located at the bottom left corner of the cuboid on the ground. The width, depth and height then determine, how far to the right, forward and up the cuboid should go. So, an easy way to create a cuboid is to first go to the bottom left corner of your area. Then save your position and go to the top right corner. Again a save. Now you use the first x,y,z as fX, fY and fZ. Then you calculate the difference between the second x,y and the first x,y and then that's your fWidth and fDepth. Now you just have to set your height (fHeight) of your cuboid. For that you could also save a position one more time, while you're up in the air. EDIT: Just drew something for you. [attachment=0]cuboid.jpg[/attachment] but what do i have to save 3 times? Link to comment
MaddDogg Posted July 21, 2010 Share Posted July 21, 2010 That was just an example of how you could get to your values easily. Just look at the thing I drew. You have to get the positions for the two blue points. How you get them does not matter. Link to comment
NotAvailable Posted July 21, 2010 Author Share Posted July 21, 2010 That was just an example of how you could get to your values easily.Just look at the thing I drew. You have to get the positions for the two blue points. How you get them does not matter. Ok! thankyou. you really helped me 60% of all things i need to learn about scripting. Link to comment
Chusmadones Posted July 21, 2010 Share Posted July 21, 2010 Is not it more effective / faster to use another function instead? local cubeArea = createColRectangle( -2680,2200, 550,380 ) -- example, and less parameters than the other func. Link to comment
MaddDogg Posted July 21, 2010 Share Posted July 21, 2010 If it meets your needs and if you have a total even area, it will definitely suffice. But with a cuboid you also have the 3rd dimension up and down, which you may need in some cases. Link to comment
NotAvailable Posted July 22, 2010 Author Share Posted July 22, 2010 Maddogs Tutorial is better Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now