Forum Groups
  All forums
    Help & Feedback
      Work in progress
      Finished Art
      Non-Max related

Maxunderground news unavailable

First page  Go to the previous page   [01]  [02]  Go to the next page  Last page
show user profile  9krausec
Hey guys, so my math skillz aren't really all that great and I'm looking for some assistance if you have the time (or you can tell me to shove off and I'll read a book or two on it).

If I have a cube with four points, and I know the world space coordinates of 2 of those points, how would I go about calculating the other points in the cube? I'm sure there is a way you math wizzes may know of (or at least the name of the equations I should be researching).

Many thanks!!

Edit: the two points of the coordinates I know are the one's pointed out below.

- Portfolio-

read 435 times
6/6/2015 3:37:31 AM (last edit: 6/6/2015 3:39:39 AM)
show user profile  Garp
If the box is aligned to the XYZ axes, it's easy.
For each coordinate, you have two possibilities. You just form all possible combinations and get the 8 points:
x1 y1 z1
x1 y1 z2
x1 y2 z1
x1 y2 z2
x2 y1 z1
x2 y1 z2
x2 y2 z1
x2 y2 z2

If the box is not aligned to the world, you're out of luck :(

read 426 times
6/6/2015 3:49:52 AM (last edit: 6/6/2015 3:54:12 AM)
show user profile  9krausec
boo. :( It's not aligned to the XYZ.

Bleh. Thanks for the help though Garp!

- Portfolio-

read 424 times
6/6/2015 3:51:02 AM (last edit: 6/6/2015 3:51:02 AM)
show user profile  Garp
There can be an infinite number of boxes with that diagonal. You need more information.

read 417 times
6/6/2015 3:58:06 AM (last edit: 6/6/2015 3:58:06 AM)
show user profile  9krausec
I'll revisit it tomorrow. What I need to do is crack into the Maya API and run "OpenMaya" which is a C++ wrapper in Python for Maya that will allow me to figure out the object space bounding box.

I figured there might of been some magic math to avoid me having to open up that can of worms, but I guess I'm diving in. :D For the best. need to learn it one way or another.

Thanks Garp though.

- Portfolio-

read 413 times
6/6/2015 4:28:26 AM (last edit: 6/6/2015 4:28:26 AM)
show user profile  Garp
If you do know the transform matrix defining the object space, then you can get the corners' positions either in the object's coordinate system or in the world's.
edit: IF the box is aligned to the axes in its local coordinate system.

read 403 times
6/6/2015 5:00:00 AM (last edit: 6/6/2015 5:02:37 AM)
show user profile  herfst1
What about finding out the normals? If you can find those out I reckon you should be able to work it out.
read 383 times
6/6/2015 10:49:31 AM (last edit: 6/6/2015 10:49:31 AM)
show user profile  Mr_Stabby
the vector from point A to B only gives you yaw and pitch, still need roll to be able to complete the matrix

read 379 times
6/6/2015 10:55:53 AM (last edit: 6/6/2015 10:55:53 AM)
show user profile  herfst1
Oh yeah, basic, basic maths. Need 3 points to draw a cube.

Here's a question, if you had 4 points could you plot a tesserract (not sure how you spell it, you know, a 4D object)?
read 372 times
6/6/2015 11:11:11 AM (last edit: 6/6/2015 11:11:11 AM)
show user profile  Mr_Stabby
trick question! you cannot accurately represent a hypercube in any way known to man. otherwise yes.

read 364 times
6/6/2015 11:46:19 AM (last edit: 6/6/2015 11:46:19 AM)
show user profile  herfst1
Apparently if you take DMT you'll see other dimensions. If you watch "Into the Void" near the beginning is a 5 minute sequence trying to represent that, it took years to make. Interesting film too, though I wouldn't call it enjoyable.
read 358 times
6/6/2015 12:02:34 PM (last edit: 6/6/2015 12:02:34 PM)
show user profile  LionDebt
Vector maths. Shit hurted my brain to learn but I feel a better man for it.

If you knew a dimension of the box (ie, width or height or whether width and height are the same)... and it was aligned to world, you could figure out the other points quite trivially. All of this to figure out the object space bounding box?

Damn, Maya be trippin.

read 348 times
6/6/2015 1:06:04 PM (last edit: 6/6/2015 1:06:04 PM)
show user profile  9krausec
Lots of replies! Thanks guys.

@LD - I'm sure there is an easier way to do this. I am however surprised that I need to reach into the Maya API for C++ to get this working (there might be a good way to do this in straight Python for Maya that I haven't found yet).

I'd think that this would be built into the xForm query command that is integrated into Python (Mel), but it only returns the standard Bounding Box.

So there are 16 floats that are in a Transform Matrix. I'm assuming this data holds the XYZ Rot, XYZ Trans and the Bounding Box? What all is included in a transform matrix anyways?

Sorry if I seem like I'm asking basic questions here. There are still some blank spots in my knowledge of fundamental 3D.

- Portfolio-

read 332 times
6/7/2015 12:33:13 AM (last edit: 6/7/2015 12:33:13 AM)
show user profile  Mr.Burns
A transform matrix usually consists of the three axis vectors and a position inside the coordinate system described by the three vectors. I can't remember what the other values are for, but most of the time they're 0, 0, 0, 1.
read 326 times
6/7/2015 1:16:40 AM (last edit: 6/7/2015 1:16:40 AM)
show user profile  Garp
I have trouble figuring out the context.
Do you have a box? Do you need to build one out of two points?
You said that you 'know the world space coordinates of 2 of those points'. Do you know the other points in the box's local space?

read 324 times
6/7/2015 1:37:34 AM (last edit: 6/7/2015 1:37:34 AM)
First page  Go to the previous page   [01]  [02]  Go to the next page  Last page
#Maxforums IRC
Open chat window