How to draw graphics referencing a coordinate system (not the global)?

Options
Ben Klinkhammer
Ben Klinkhammer Member, Employee Posts: 7
First Anniversary Name Dropper First Comment
✭✭✭

For pure translation, I found I can use
Graphics.Scene.Transformation3D.Translate and then draw the graphics.

For transformations with translation and rotation I found the function:
Graphics.Scene.Transformation3D.Set which I thought I could use in similar way and then draw the graphics, but I'm not figuring out how to use it properly...

I am trying to do something like:
globalCS = Model.CoordinateSystems.Children[0]
localCS = Model.CoordinateSystems.Children[1]

I found I can find the transformation like:
localCS.Matrix

But I'm not sure how to use that with the Graphics.Scene.Transformation3D.Set command
So, instead I tried:

globalCS = Model.CoordinateSystems.Children[0]
localCS = Model.CoordinateSystems.Children[1]
x_axis = localCS.XAxis
y_axis = localCS.YAxis
z_axis = localCS.ZAxis

x_axis_vector = Vector3D(x_axis[0], x_axis[1], x_axis[2])
y_axis_vector = Vector3D(y_axis[0], y_axis[1], y_axis[2])
z_axis_vector = Vector3D(z_axis[0], z_axis[1], z_axis[2])

identity = Matrix4D()
transformation = identity.CreateSystem(x_axis_vector,y_axis_vector,z_axis_vector)
transformation.Transpose()
Graphics.Scene.Transformation3D.Set(transformation)

But that also didn't work. Can anyone please let me know what I'm doing wrong?