Announcement

Collapse
No announcement yet.

Get Extents of a Static Mesh

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Get Extents of a Static Mesh

    Hey,

    Trying to find where the far left/right extents of a static mesh are. Get Local Bounds sounds like it would do it, but either I'm not sure how to use the result or it's not what I'm looking for.

    Example: I need the two red dot locations here:

    Click image for larger version

Name:	bounds.jpg
Views:	1
Size:	27.3 KB
ID:	1141119

    #2
    Yeah, Get Local Bounds should do. It takes the pivot as 0 and gives the location of the each side of the bound relative to it, so in your case adding Min and Max values of the Y axis will give you that distance between each points.
    FREE Lightshow
    FREE VR Drum Kit Project

    FREE Color LUT Collection
    FREE Physics Driven Spacecraft Project
    FREE GTA Style Vehicle Interaction
    Dynamic DoF(Depth of Field)
    Camera Crossfade

    Comment


      #3
      Ah, I understand how it works now - thanks.

      Also a note for anyone else who reads this, you have to multiply the vectors from Get Local Bounds by the scale of the object to get the world space bounds.

      Comment


        #4
        Hrm, I have an issue with this.

        If my object is at 0, 0, 0. And it's scale is 9, 9, 9. And it is a cube of 1cm:

        Get Local Bounds min will return -0.5, -0.5, 0
        Get Local Bounds max will return 0.5, 0.5, 1

        Then if we multiply the min/max by the scale of 9 then we get:
        Min: -4.5, -4.5, 0
        Max: 4.5, 4.5, 9

        And that is fine, by multiplying by the scale we compensate for the fact it is performed in local space.

        Except... Then I rotate by 45 degrees on Z.

        How do I get the correct location of the bounds now? They're placed as if the object is not rotated.

        Comment


          #5
          Nevermind, I have solved it.

          Rotate Vector Around Axis on the Min/Max fixes it.

          Comment

          Working...
          X