If you work with the Box in plane coordinates, shouldn’t those vertices always stay the same (as the box rotates with the plane, and the min / max vertex is always the same one in relation to the plane) ?
Ok i get now whats your point here but i need to rotate this in all axis not only around x thats why i decided to create plane based on z axis. Cross product for y axis is obvious but how to calculate the perpendicular vector to z vector for x axis ?
I have in mind stable xaxis vector - Vector3d method PerpendicularTo() gives the same shifty result.
Well I guess the problem here is, that the orientation of xAxis and yAxis are not determined in that case (they can rotate arbitrarily around the plane normal, which I guess you already know ). Not sure I get what the larger plan is here?
I have not gone through all the examples, but if your goal is to rotate a plane in space, why not apply rotations to a plane in the first place? Or construct a plane in the beginning and then use the transformation info from the rotations and apply it to the plane?
@RadovanG thank you very much for input on this. Your idea is indeed good but the thing is that this cone should stay on its place because i need bbox of it but bbox needs to be oriented along normal axis (so bbox is changing basis from world to custom coord system - like in example from @dale in post no.4) the cone itself should NOT move
I tried to reverse your idea but if i get it correctly it behaves that way cause of change basis matrix ? migrating_bbox_points_modif7.gh (18.0 KB)
I’m not sure this time because this part with rotation was just to show that when vector is different then bbox base points are going nuts - i think it is similar solution to this from modif5 file where i was rotating plane in c# block ( called Custom Plane Rotation ) isn’t it the same approach?
Probably, I have not gone through all the solutions in the various C# scripts…
I guess I still don’t get what you want to do, and where your problem is, sorry. As far as I understood you wanted to track the corner vertices of a moving bounding box, which actually never was a problem in the first place, as it was only a result of the way the orientation plane of the bounding box was constructed.
I need to create bbox aligned to object based on one axis and from this bbox i get corners which i need to define xy axis for bitmap mapping. But when axis is changing for eg. from vec = 0,0,1 to vec = 0.25,0.25,1 (i wrote here arbitrary numbers just for eg.) corners of bbox are fliping mirroring etc.
Hmm in my opinion the problem is mathmatically underdefined… your plane can arbitraryly rotate around the normal axis, thus at least the numbering of the 4 top corners and the 4 bottom corners of your derived bounding box will always be arbitrary (feel free to prove me wrong )
Any chance you can track the movement of the vector? In that case attach the plane to the vector or apply this movement to plane…
First of all, it is good not to use misleading terms - bbox aligned to object is not correct term. BBox of a geometry is aligned to a plane so bbox is defined by the geometry and “aligned” plane.
Here is solution where geometry (object) stays still and plane is rotating. migrating_bbox_points_modif7.gh (28.6 KB)
I understand that my explanation was misleading probably however now when you use those rotations it works as i would predict however i have still only one vector as an input so i’m trying to reverse that from Vector angles to get desired plane but without luck - for sure i don’t understand something here…
@RadovanG would you mind to take a look on code in those two top c# components? I’m not sure why i’m still getting different results