Jump to content

  •  

  • iBotModz CBox


    Photo

    Yaw, Pitch, & Roll


    • Please log in to reply
    2 replies to this topic

    #1 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 08 November 2007 - 07:02 PM

    CaptainPoopface
    Posted Image



    NOTE:This is a lot to read, and it requires thought. There is some math andother boring crap in here. It will take a few minutes to get through(Patience?! What's that? Posted Image I'd rather just post a redundant thread and hope someone comes to my rescue! Posted Image ). But it will save you perhaps hours of frustration when positioning your objects.

    So grab a b- uhhhh, soda, and let's give that attention span a workout.

    As we know too well, BSP Viewer will botch the rotation of your objectsif you try to adjust more than one type of rotation per object. Thistutorial will describe yaw, pitch, roll, and the numeric values you canuse to set them yourself. Once you understand them and can visualizethem properly, you can orient your objects without relying on the BSPViewer at all.

    First, some definitions.

    Yaw is defined as rotation about the z axis. In most coordinatesystems, z points straight up and down. When you spin a basketball onyour finger, the ball is "yawing." This is probably the easiest angleto visualize.

    For our purposes, pitch is probably best defined as front-to-backrotation. If you do a backflip, you are "pitching." It's a rotationabout the side-to-side axis, which in the Halo convention is the yaxis.

    Roll is side-to-side rotation. When a windshield wiper rotates across the windshield, it is "rolling."

    Here are some images to help you visualize the rotations. They areslightly confusing because the camera perspective changes. Assume forall three pictures that the space shuttle is sitting flat on theground, with the nose pointed in the positive x direction.

    Posted Image
    Posted Image
    Posted Image

    These angles are expressed in radians. Radians describe an angle interms of how much circumference of a circle it spans. As you know fromgeometry, the circumference of a circle is defined as 2*pi*r, where ris the radius of the circle and pi is approximately 3.14. So, onecomplete circumference of a circle is 6.28 radians ( = 2*pi*radius). Ifyou want to go one fourth of the way around the circle, which is 90degrees, that's going to be the angle all the way around the circledivided by 4. So 6.28 / 4 ~= 1.57.

    Any possible angle of rotation can be described as a value between0 and 6.28. In degrees, as you know, any angle can be described between0 and 360. An angle greater than 6.28 radians simply "goes around thecircle again," and anything less than 0 radians begins rotating in theopposite direction, until -6.28, when it wraps all the way around andstarts over.

    You can convert between angles and degrees by following some simple algebra:
    360 degrees = 2*pi radians
    -> degrees = 2 * pi radians / 360
    -> degrees = pi * radians / 180

    So, to convert from degrees to radians, multiply your angle indegrees by pi/180. I'm assuming you have some familiarity with what a90 degree angle looks like, as well as a 180 degree angle and a 45degree angle. If you can't visualize these, you're in trouble...Practice until you can. Knowing just those three angles, you can domost of the rotations you want.

    45 degrees ~= .785 radians
    90 degrees ~= 1.57 radians
    180 degrees ~= 3.14 radians


    These three angles are the workhorses.

    Keep in mind that each object has its own x, y and z axes definedfor it, and your rotations will start from this default position. Thereis not a universal set of xyz axes that every object follows. Forexample, the delta control bridge by default is flat (parallel to theXY plane), and oriented so that its longest dimension is along the xaxis. The windmill in Zanzibar, however, is oriented by default in thevertical position, rotating about the x axis (Q: What type of rotationis this? A: Roll!). This is important to remember because if, forexample, you want the windmill to lie flat, you're going to have topitch it forward or backward, whereas intuitively, you might expectthat the windmill is already pitched by 90 degrees in order to standup. Not so!

    ***THIS IS WHAT MAKES THE CONTAINMENT BASE GATE DIFFICULT TO WORKWITH. Its axes and rotations are defined from its default position,which is angled up, and this makes the rotations much harder tovisualize. When it rolls, it does NOT roll about the axis of the longplank, but about the axis passing through the long plank at one point,perpendicular to the little square pieces at the top. So that meansit's going to rotate in a funky cone fashion, not the nice, easy circleyou'd expect. Yaw is also going to rotate in a funky cone fashion, forthe same reason. Until you really know your YPR, don't try to get tooclever with rotating the Containment base gate. And even once you knowyour YPR, I'd still recommend avoiding it, unless you are ONLYmanipulating one angle, in which case you can use the BSP Viewer.Otherwise, spare yourself the frustration. Use something else.

    Things to remember:

    - When visualizing rotations, it helps if you think of one type ofrotation at a time. Start by thinking of the default orientation of theobject (ALWAYS remember this), and then say to yourself, for example,"I need to yaw it by 90 degrees, then pitch it up by 45 degrees." Thenenter those values (in radians) in the appropriate reflexive.

    - When cloning a chunk or replacing an object, I always overwrite its initial YPR settings with 0,0,0 in the Meta Editor.

    -Think in degrees, then convert to radians. It's still much more natural for me to say "90 degrees" than "1.57 radians."

    -You will have to check your work by FTPing your map and loading itup. It's a hassle, but it sure beats getting the object exactly inposition in the BSP Viewer, only to find that it's completely botchedin the game. As you get better, you'll make fewer mistakes and will bemore confident making more changes at once.

    -If you adjust more than one angle of rotation for an object, youMUST distrust what you see in the BSP Viewer. Only trust what you seein game. Also, I am not certain about this, but if you accidentallyadjust more than one type of angle in BSP Viewer (e.g., you Alt-clickand drag, then Ctrl-click and drag the same object), I believe thatobject is cursed ever after. Even if you reset its angles to 0 andstart over, it is forever confused. I'm not 100% certain about this,but I have observed it some of the time. Just crank the z coordinate onthe cursed object to get it out of sight, and start with a brand newone (a different chunk).

    -If you find that the object is at the angle you want but facingexactly the opposite direction you want, add 180 degrees ( = 3.14). Ifyou notice that the object is rotating around the axis you want but inthe wrong direction, reverse the sign of the angle (positive/negative).This means the rotation will start in the opposite direction. If yourangle is greater than 6.28 or less than -6.28, you've gone too fararound. Try to keep it within +-6.28 so you can recognize some angleswhen you see them numerically (you'll soon memorize .785, 1.57, and3.14).

    -If you're really having trouble, isolate one angle at a time -yaw, for example. Think of what it is in degrees, convert to radians,then enter it, FTP to the Xbox and check. If that angle is correct,move on to roll and pitch.

    -Very seldom will you have to adjust all three angles. I have donemost of what I needed to by only manipulating two of the angles at atime. The designers of the maps tend to orient the maps with xyz axesthat are similar to those of the objects, although they are not alwaysthe same. That tends to make it easier on you, if you are somewhatfollowing the map geography. Even if you are not using the BSP forgameplay purposes at all (e.g., a race track), try to orient yourpieces in accordance with the landmarks of the BSP so you can visualizemore easily.

    -Always try to start your visualizing and rotating from a piecethat has 0 YPR. If you are starting from a piece that is alreadyrotated in one or more of those angles, it's harder to visualize. Ofcourse, if you are fine-tuning the orientation of an object, you'llhave to adjust an already rotated object. But the point is, once you'vegot that object rotated and positioned and you need to rotate andposition a new object, start it with no YPR and visualize from there,instead of copying the YPR of a rotated object.

    -If you can get away with only adjusting one angle, do it! Use theBSP Viewer, even. However, if you know you'll need to adjust more thanone angle, and one of those angles is "unusual," like 30 degrees or 75degrees or something, but the other angles are more conventional, dothe unusual angle in the BSP Viewer, then manually set the other anglesyourself. MAKE SURE YOU CHOOSE THE CORRECT ROTATION THE FIRST TIME INBSP VIEWER THOUGH. If you choose poorly, you must either start with anew object, or cease to use the BSP Viewer for that object and proceedmanually, in order to avoid botched rotations and cursed objects.

    I hope this helps. It takes practice, like anything else.

    #2 pyrosquirrell

    pyrosquirrell

      Private

    • Donors+

    • 31 posts
    • Joined: 07-October 07
    • Gender:Male

    Posted 16 July 2008 - 10:00 AM

    wow thanks dude. i guess im the only one really interested in this kinda stuff

    #3 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 16 July 2008 - 06:45 PM

    wow thanks dude. i guess im the only one really interested in this kinda stuff


    Thanks for using my display name. Don't let it happen again :)