Getting vertex locations of box

I’m trying to get the two end points along the y axis for a decal component, basically like this:

Screenshot (110)

However, when I change the rotation of the box, it obviously doesn’t work because it messes with the extents. To work around that I’ve saved the box extents from the starting 90 degree angle and used those to draw a debug box. The debug box works perfect, if I could find it’s vertices it would serve me well.

Screenshot 2024-02-09 014301

I’ve tried for about 2 days now to rotate the extents and the origin points but can’t seem to gather the locations of those two positions when the box is rotated.

Does anyone know the calculations for actually getting the point locations after a rotation using the origin and extent? Any tips would be helpful, thanks!

1 Like
  • this is my scaled box:

image

  • I capture its extents before any rotation is applied and only then rotate it:

  • the result of the above (ignored Z on purpose for simplification):

image

  • to get verts with Z:

  • to get the points I think you originally mentioned:

image


Hope I got the intent right!

1 Like

Thank you man! Genius!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.