Skip to content
Discussion options

You must be logged in to vote

I finally got it working, and the solution is relatively simple with the correct methods, order of operations and so on.

Here's the code for finding out the centre of the shape:

mirror_shape = mi.load_dict({
    'type': 'ply',
    'filename': '/<your file path>/Mirror.ply',
    'face_normals': True
})

# Get the bounding box of the shape
bbox = mirror_shape.bbox()

# Get the centre
center = bbox.center()

And then in XML you simply do the following:

        <transform name="to_world">
            <translate value="-2.17873, -1.79809, -0"/> # THE NEGATIVES OF YOUR CENTRE COORDINATES. MOVES TO ORIGIN
            <rotate value="1, 0, 0" angle="60"/> # EXAMPLE ROTATIONS
            <rotate value=

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
3 replies
@mohanamisra
Comment options

@njroussel
Comment options

@mohanamisra
Comment options

Comment options

You must be logged in to vote
6 replies
@mohanamisra
Comment options

@merlinND
Comment options

@mohanamisra
Comment options

@merlinND
Comment options

@mohanamisra
Comment options

Answer selected by mohanamisra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants