mitsuba-renderer / drjit

Dr.Jit — A Just-In-Time-Compiler for Differentiable Rendering
BSD 3-Clause "New" or "Revised" License
603 stars 45 forks source link

ScalarTransform4f to numpy/torch #170

Closed andyyankai closed 1 year ago

andyyankai commented 1 year ago

Is there anyway to convert a transform matrix to numpy? like rot = T.rotate([0,1,0], 90) rot.numpy()

merlinND commented 1 year ago

Hello @andyyankai,

Assuming that T refers to a Mitsuba 3 transform, you can get the underlying transformation matrix in NumPy or Torch as follows:

rot.matrix.numpy()
rot.matrix.torch()

Otherwise, please let me know what T stands for in this case.