So I'm confused about how to find the pci vector of roll axis of a part, similar to how we have craft roll axis vector block, i want to calculate a parts roll axis meaning the pci vector. Immense Help needed.

Edit: Solution is to

Use local to pci block, specify part, input vector 0,0,1(1 being specific parts pci postion)

Tags
Question

9 Comments

  • Log in to leave a comment
  • Profile image
    1,159 YaMomzBox420

    @TritonAerospace that makes more sense now. I figured it was something for a moveable part. To isolate a single component of a vector, you either multiply the vector by the unit vector(in this case (vector*(0,0,1))) or you find the (vector()(z axis)) block in the math tab and input the vector there. Also, I forgot to mention, Unity uses a weird coordinate system that makes some stuff backwards, so you might have to play with it. In standard coordinates, x and y go from the center of the planet to the equator and z goes to the poles, but unity has x and z on the equator and y going through the poles. This isn't a big deal, but it makes it more complicated when doing vector math because you have to remember everything is backwards or it won't work right(especially with cross products :/ the cross product of two vectors will always be at 90° to the original two, but in unity it's the opposite direction from standard)

    And no problem, it took me months of messing around with vectors to finally understand how they work. I even had to go through a number of physics textbooks at the library just to get a good understanding of them(and I still have problems lol)

    +1 1.5 years ago
  • Profile image

    @YaMomzBox420 oh yes i was trying to find where a camera parts z axis was pointed to according to Nav(North) to then use a PID to subtract that from a targets bearing making it point at the target, i didn't know Vector Block wasn't needed someone told me in discord to isolate the component you wanta for me i needed z therefore (0,0,1) i had no idea you didn't need it lol, vectors are not my strong suit.
    But it's all good now i got everything Thanks alot for the informative comments it will definitely come in handy next time i restart the project (it didn't function well).

    1.5 years ago
  • Profile image
    1,159 YaMomzBox420

    Also, it's been a while(about a year in fact) since I've done much with vectors and stuff in the game. I also can't remember the easy way to find pitch yaw and roll using an arbitrary vector, and it's not easy to find the specific post it was in

    1.5 years ago
  • Profile image
    1,159 YaMomzBox420

    @TritonAerospace lol it's all good.

    So I'm still kinda lost on exactly what you're trying to do with this. Maybe you could explain what the purpose of the code is and how it's supposed to work.


    There's also a few things that I gotta point out to help you. To start, the [nav(position)] block returns a value in vector format, so there's no need to put that in a (vec()()()) block. Second, the [nav(position)] block gives you the line from the center of the parent body to the "center" of the craft(or part). This line will ALWAYS point straight up from the ground unless you do some vector math with it.


    I think I kinda see what you might be trying to do and I might have a better way. Subtract the [part()(position)] vector from the [Nav(position)]{or another parts position} vector(or the other way around if that's backwards). This will give you a new vector that goes from the part to the "center" of the craft(or another part) and you can then measure the angle between this vector and a few others(nav position and cross products) to get pitch, yaw, roll(if done properly, for a specific part of a craft, seperately from the crafts actual pitch,yaw,roll)

    1.5 years ago
  • Profile image

    @YaMomzBox420 sorry my reply took look long i didn't see notification.

    Perhaps i didn't word it right here it is

    And if you use angle block between this and nav position it works to find angles of left to right (yaw) up down(pitch) and roll surprisingly

    1.5 years ago
  • Profile image
    1,159 YaMomzBox420

    Hmmm. Something about that doesn't seem right. (0,0,1) is a unit vector with a magnitude of 1 in the z axis, which you can use to constrain a vector in a specific direction or turn a non-vector value into a vector in the specified direction. In PCI (0,0,1) will always point in the same direction relative to space and is therefore a constant value[(1,0,0) and (0,1,0) being the x and y unit vectors respectively]. In local, the x, y, and z axes are fixed to the craft and change values as the craft moves. The x axis is the crafts roll axis, y is pitch, and z is yaw.

    The actual PCI coordinates of whatever part you're messing with should look more like: (3.937153849,1.765893355,0.00027370) and at least two of those numbers will slowly but constantly change even if the craft is grounded because the planet is rotating underneath

    1.5 years ago
  • Profile image

    @YaMomzBox420 okay will try that

    1.5 years ago
  • Profile image
    1,159 YaMomzBox420

    Look up "Earth Centric Inertial coordite system" to get a pretty good rundown of exactly how PCI(Planet Centered Inertial) works. If you've already gotten that far, it's just a matter of finding the right block in vizzy. Gimme a bit and I'll check it out

    1.5 years ago
  • Profile image

    @TronicOrbital i may have not explained well.
    What i mean by roll axis is the roll pci vector of a part meaning the current vector that a part is pointed to.

    1.5 years ago

No Upvotes

Log in in to upvote this post.