Jump to content

colrectangles: how to?


Recommended Posts

Posted

Hello everybody,

I need a colrectangle, but i don't know how i need to get the coordinates and the size of it.

How math all that, does someone know it?

Why looking here, while my post is up there /\ :)

Posted

Hello everybody,

I need a colrectangle, but i don't know how i need to get the coordinates and the size of it.

How math all that, does someone know it?

Why looking here, while my post is up there /\ :)

Posted

..... what?

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted

..... what?

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted

I know the function. But lets take a look at the arguments:

float fX, float fY, float fWidth, float fDepth

How to get these stuff, the x, y, and width and depth?

That is my question.

Why looking here, while my post is up there /\ :)

Posted

I know the function. But lets take a look at the arguments:

float fX, float fY, float fWidth, float fDepth

How to get these stuff, the x, y, and width and depth?

That is my question.

Why looking here, while my post is up there /\ :)

Posted

Are you being serious now or do you make a joke out of us?

You must know the location (X,Y) where you want it to be...

https://community.multitheftauto.com/index.php?p= ... ils&id=124

Width and depth depend on you.. weather you want it to be huge or small... You decide.

Posted

Are you being serious now or do you make a joke out of us?

You must know the location (X,Y) where you want it to be...

https://community.multitheftauto.com/index.php?p= ... ils&id=124

Width and depth depend on you.. weather you want it to be huge or small... You decide.

Posted

Ho ho, i don't make a joke out of you. I never will.

Lets get it more complicated. I've made a rectangle in photoshop:

rectn.png

There are 5 points there:

1. left top

2. right top

3. left bottom

4. right bottom

5. center

Now, i want to know at what point i need to get x and the y. And how to math the width and depth. I hope that explains some more about my question.

Why looking here, while my post is up there /\ :)

Posted

Ho ho, i don't make a joke out of you. I never will.

Lets get it more complicated. I've made a rectangle in photoshop:

rectn.png

There are 5 points there:

1. left top

2. right top

3. left bottom

4. right bottom

5. center

Now, i want to know at what point i need to get x and the y. And how to math the width and depth. I hope that explains some more about my question.

Why looking here, while my post is up there /\ :)

Posted
As you said #"3. left bottom" (south-west -> X, Y). Width is distance between #3 and #4, depth is distance between #3 and #1 (or the other way around).

What do you want to calculate?

If i read good:

from position 3 i need to get the x coord

from position 4 i need to get the y coord

and from 3 to (x coord) 1 i can calculate the depth

and from 3 to 4 i can calculate the width

Am i right?

Why looking here, while my post is up there /\ :)

Posted
As you said #"3. left bottom" (south-west -> X, Y). Width is distance between #3 and #4, depth is distance between #3 and #1 (or the other way around).

What do you want to calculate?

If i read good:

from position 3 i need to get the x coord

from position 4 i need to get the y coord

and from 3 to (x coord) 1 i can calculate the depth

and from 3 to 4 i can calculate the width

Am i right?

Why looking here, while my post is up there /\ :)

Posted
As you said #"3. left bottom" (south-west -> X, Y). Width is distance between #3 and #4, depth is distance between #3 and #1 (or the other way around).

What do you want to calculate?

If i read good:

from position 3 i need to get the x coord

from position 4 i need to get the y coord

and from 3 to (x coord) 1 i can calculate the depth

and from 3 to 4 i can calculate the width

Am i right?

Of course you're wrong :?

Read it again.

TIP: A point has a location (x, y).

Posted
As you said #"3. left bottom" (south-west -> X, Y). Width is distance between #3 and #4, depth is distance between #3 and #1 (or the other way around).

What do you want to calculate?

If i read good:

from position 3 i need to get the x coord

from position 4 i need to get the y coord

and from 3 to (x coord) 1 i can calculate the depth

and from 3 to 4 i can calculate the width

Am i right?

Of course you're wrong :?

Read it again.

TIP: A point has a location (x, y).

Posted

Ahh, i think i got the point.

So i go to point #3 save the coords, that are the x and y coords.

Then i go from point #3 to #4 and then get the distance with the function getDistanceBetweenPoints2D that is the width.

Then i go from point #3 to #1 and with the same function i get the depth.

Am i right now? :)

Why looking here, while my post is up there /\ :)

Posted

Ahh, i think i got the point.

So i go to point #3 save the coords, that are the x and y coords.

Then i go from point #3 to #4 and then get the distance with the function getDistanceBetweenPoints2D that is the width.

Then i go from point #3 to #1 and with the same function i get the depth.

Am i right now? :)

Why looking here, while my post is up there /\ :)

Posted
Ahh, i think i got the point.

So i go to point #3 save the coords, that are the x and y coords.

Then i go from point #3 to #4 and then get the distance with the function getDistanceBetweenPoints2D that is the width.

Then i go from point #3 to #1 and with the same function i get the depth.

Am i right now? :)

Sort of. You don't have to use getDistanceBetweenPoints2D because you can't rotate colshapes, so rectangle has always straight line along X and Y axis.

Posted
Ahh, i think i got the point.

So i go to point #3 save the coords, that are the x and y coords.

Then i go from point #3 to #4 and then get the distance with the function getDistanceBetweenPoints2D that is the width.

Then i go from point #3 to #1 and with the same function i get the depth.

Am i right now? :)

Sort of. You don't have to use getDistanceBetweenPoints2D because you can't rotate colshapes, so rectangle has always straight line along X and Y axis.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...