Jump to content

colrectangles: how to?


Recommended Posts

I can't believe you cannot do basic rectangle coordinate maths.

As 50p said, the x,y settings you feed in are your point #3 world co-ordinates. Let's call them 100,200.

Then get the other extreme co-ordinates, point #2. I'll name them x2 and y2. Let's say they come out as 400,700.

to get width, it's as simple as x2 - x (300). To get depth, y2 - y (500).

Giving you:

myCol = createColRectangle ( 100.0, 200.0, 300.0, 500.0 )

or

local x, y, x2, y2 = 100.0, 200.0, 400.0, 700.0
myCol = createColRectangle ( x, y, x2 - x, y2 - y )

Link to comment

I can't believe you cannot do basic rectangle coordinate maths.

As 50p said, the x,y settings you feed in are your point #3 world co-ordinates. Let's call them 100,200.

Then get the other extreme co-ordinates, point #2. I'll name them x2 and y2. Let's say they come out as 400,700.

to get width, it's as simple as x2 - x (300). To get depth, y2 - y (500).

Giving you:

myCol = createColRectangle ( 100.0, 200.0, 300.0, 500.0 )

or

local x, y, x2, y2 = 100.0, 200.0, 400.0, 700.0
myCol = createColRectangle ( x, y, x2 - x, y2 - y )

Link to comment

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...