var tx = ExtractedTx/1000
var ty = ExtractedTz/1000 // Swap Y and Z
var tz = ExtractedTy/1000 // Swap Y and Z
var rx = ExtractedRx/360
var ry = -ExtractedRz/360 // Swap and negate Rz for Y-up system
var rz = ExtractedRy/360 // Swap Ry with Rz
var sx = ExtractedSx/1000
var sy = ExtractedSz/1000
var sz = ExtractedSy/1000
You should make a test object, like arrow, a size of 1 unit, then you need to create same object by hand in vvvv, then you can start aligning.
Normally i would start with just importing a geo as is (only degrees converted) and apply to that a root transform (the one that rotates object against 0,0,0 point). Basically if you fix scene transform, you can then apply same logic to values you build or just directly multiply.
The point is, it’s easier to assemble transform directly then apply axis conversion (scale, rotate, transform)
I think @tonfilm can answer this probably, as we had to do this conversion many times, but I seem to remember that it is easier to do with Quaternions (for the rotation) or Matrixes.
Here is a cool chart by the incredible Freya Holmér:
@antokhio
Attached a clean version with all the referenced files
I have compared the rhino file (with the Rhino reader) with the imported csv.
Made some negative switches to the imported csv data but still not able to visualize it correctly. I have chatgpted who s suggesting quaternions but not clear to me and apparently to it as well since it did not give me proper instructions. @bjoern thank s for the lead, it would be definitely great to learn it properly, need some time. If someone knows a shortcut,
@ joreg I have tried CoordinateSystemConversion [3D.Transform] with no luck, everything was completely messed up a help file would be gold for me. testVVVVImportRhinoCSV.zip (96.8 KB)
thanks @bjoern for mentioning the course, but unfortunately i did not cover the “converting rotations” issues there. orientations/rotations can be really a super confusing topic as one has to be aware in detail what the data represents and how to convert it to the desired system (i’ve been several times at the point where i thought that i know what i’m doing, just to find out that my mental model does not work as expected).
however - as @seltzdesign already mentioned, from my experience it is mostly easiest to convert to quaternions, do a transformation there (usually flipping and negating one or more components) and then convert back to the desired format (or leave it as quaternion).
unfortunately i’m quite busy right now so i cannot look into your patch atm :(
i just had a few minutes on the train and had a quick look:
your data is stored in SRT form (a vector for each scale, rotate and translate)
translation can be simply handled by exchanging and negating compontents to convert the axis
rotation is stored as an “Euler rotation sequence”. this is the format that is loathed by anyone dealing with rotations in 3D for a number of reasons (quaternions are usually preferred).
important: these are actually 3 rotations (around 3 individual axis) performed in a certain sequence. if you don’t know which sequence/hierarchy this is, you will not succeed in converting them. in VVVV we have the sequence ZXY (by default), other programs might do this differently or even allow you to set the sequence (in VVVV this can be done by performing 3 different rotations in a row, where only one axis is rotated.
if you can find out what sequence we have here, we might be able to convert it. whithout that info it’s just guessing…
I remember doing a lot of transfers of transformation data the other way, from vvvv to Grasshopper many years ago. I might be able to dig out a patch, but I seem to remember that I actually wrote transformation matrixes into the .csv in the end, because they are easier to convert. Pretty sure you had to flip the matrixes and then swap a few things around. I’ll see if I can find it.
Here is the vvvv part. Its still in vvvv beta since its from 2017, but you will get the gist. Important is the Transpose part to transpose the matrixes to the other format, then write the values. In GH you read the values and swap the values around.
But what is confusing me is that, inside of vvvv, it means XZY? Since we are talking about a rhino coordinate system with Z up and vvvv with Y up? So first I should swap Y and X from the incoming data and then applying that order? I will give another attempt.
Already used VL.Rhino.3DM for some time and it works wonderfully doing the transformation job for you,+ filtering, taggging etc.
But unfortunately it looks not dealing properly with the rhino blocks (called InstanceReference), as you may want to check from the file attached. The matrix coming out from the Split node seems reading only the translation. Please correct me if I am doing anything wrong.
My job requires exactly translating thousands of block instance transformations, so this nuget looks useless for the purpose.
so with some swapping and negating, you can convert the rhino matrix to a vvvv matrix. but I am not sure in what form the matrix from the Rhino lib comes and what processing has to be done. maybe you can access the original XFrom from Rhino somewhere.