using System.Text.Json;
namespace CodeFromJson
{
public class Root
{
public Translation translation { get; set; }
public Rotation rotation { get; set; }
public Origin origin { get; set; }
}
public class Origin
{
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
}
public class Rotation
{
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
}
public class Translation
{
public float x { get; set; }
public float y { get; set; }
public float z { get; set; }
}
public static class CodeFromJson
{
public static void Main(string[] args)
{
Console.WriteLine("JSON Input:");
string? jsonString = Console.ReadLine();
var tf = JsonSerializer.Deserialize<Root>(jsonString!);
Console.WriteLine($"tf.Translation.X = {tf?.translation?.x}");
Console.WriteLine($"tf.Translation.Y = {tf?.translation?.y}");
Console.WriteLine($"tf.Translation.Z = {tf?.translation?.z}");
Console.WriteLine($"tf.Origin.X = {tf?.origin?.z}");
Console.WriteLine($"tf.Origin.Y = {tf?.origin?.y}");
Console.WriteLine($"tf.Origin.Z = {tf?.origin?.z}");
Console.WriteLine($"tf.Rotation.X = {tf?.rotation.x}");
Console.WriteLine($"tf.Rotation.Y = {tf?.rotation?.y}");
Console.WriteLine($"tf.Rotation.Z = {tf?.rotation?.z}");
}
}
}