+ Reply to Thread
Page 2 of 8 FirstFirst 1234 ... LastLast
Results 11 to 20 of 76
Like Tree4Likes

Thread: applyTorque Tutorial

  1. #11
    Wire Sofaking SpectreCat's Avatar
    Join Date
    Mar 2008
    Location
    Sammamish, Washington
    Posts
    504

    Default Re: applyTorque Tutorial

    Great Tutoiral

    Only have one small thing I didnt like:



    Yellow + White = BAD

    New to the E2? Try my Tutorial:
    A Beginners Guide to Expression 2



    ***Please send a PM before you add me to friends***

    Quote Originally Posted by chinoto View Post
    E2 is not complicated, but many of the people who use it do complicated things with it.

  2. #12
    Wire Sofaking Fizyk's Avatar
    Join Date
    Jun 2008
    Location
    Łomianki, Poland
    Posts
    740
    Blog Entries
    1

    Default Re: applyTorque Tutorial

    Quote Originally Posted by -HP- View Post
    Thanks Now I know how to use it, but not why the hell it works like this (wtf is cross)
    That is a thing for a whole another tutorial I actually thought of making a tutorial on basic maths and physics to help people understand what they actually do, I might make one in the future.
    About cross, for now try this: [ame=http://en.wikipedia.org/wiki/Cross_product]Cross product - Wikipedia, the free encyclopedia[/ame]

    Quote Originally Posted by Syranide View Post
    In my opinion, a reference to wheels wouldn't hurt. It personally helps when I visualize torque as it is for wheels on cars, that they sit on an axis which spins in either direction.
    Hmm, maybe you are right. I didn't think of wheels when making this tutorial.

    Quote Originally Posted by SpectreCat View Post
    Great Tutoiral

    Only have one small thing I didnt like:

    [ image ]

    Yellow + White = BAD
    Oh right, the arrow is visible quite clearly and I didn't notice it might be hard to read the text. I might change that.

    Also, thanks for your positive feedback

    My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
    My tutorials: applyTorque - Quaternions - PID controllers
    Some other things I made: FT Chip - RK4 Solar System

  3. #13
    Wirererer Tayg0's Avatar
    Join Date
    Aug 2008
    Posts
    144

    Default Re: applyTorque Tutorial

    Okay, I get how cross works now, and i see how that could be used as an axis, but I don't get how you can use that to control the torque,


    Edit:
    Okay nevermind I think i get it now,but I still don't get why you used vec(1,0,0) instead of E:forward()

  4. #14
    Wire Sofaking Jimlad's Avatar
    Join Date
    Dec 2008
    Posts
    941

    Default Re: applyTorque Tutorial

    I have a lot of questions about the logic behind adding applyTorque, which might suggest why it isn't being used so much... but for now, is it me or does it seem to apply double the amount of force to props as applyAngForce? In the very least it should be consistent with units of torque.

  5. #15
    Wire Sofaking nescalona's Avatar
    Join Date
    Apr 2007
    Location
    Shoreline, Washington
    Posts
    1,299

    Default Re: applyTorque Tutorial

    You could test that by combining a torque vector (say, (1,0,0)) with the principal moments of inertia - your no-gravity'd prop should accelerate by one radian per second per tick.

    entity():applyTorque(vec(entity():inertia():x(),0, 0)) should do it. Run that once and the prop should get an angular speed of 1 rad/s. Of course, source handles rotation in a really absurd way so acceleration bears only a distant relationship to velocity (whether angular or linear). It should be approximately correct, though.

    @tayg0: because applyTorque takes an intrinsic vector (one measured according to local axes), not an extrinsic one (one measured according to world axes). In this, it is unlike applyForce.
    Last edited by nescalona; 08-23-2009 at 09:12 PM.

  6. #16
    Wire Sofaking Fizyk's Avatar
    Join Date
    Jun 2008
    Location
    Łomianki, Poland
    Posts
    740
    Blog Entries
    1

    Default Re: applyTorque Tutorial

    Quote Originally Posted by Jimlad View Post
    I have a lot of questions about the logic behind adding applyTorque, which might suggest why it isn't being used so much... but for now, is it me or does it seem to apply double the amount of force to props as applyAngForce? In the very least it should be consistent with units of torque.
    Oh yeah, you're right, it really does apply 2 times more force. Can someone fix that? Just change dir and dir*-1 into dir*0.5 and dir*-0.5
    in calls to ApplyForceOffset.

    My programs: BIOS - Alcyone - Calculator - Notepad - Movie Player
    My tutorials: applyTorque - Quaternions - PID controllers
    Some other things I made: FT Chip - RK4 Solar System

  7. #17
    Wirererer Tayg0's Avatar
    Join Date
    Aug 2008
    Posts
    144

    Default Re: applyTorque Tutorial

    Quote Originally Posted by nescalona View Post
    @tayg0: because applyTorque takes an intrinsic vector (one measured according to local axes), not an extrinsic one (one measured according to world axes). In this, it is unlike applyForce.
    Ohhh, so 1,0,0 would always be forward, the axis changes along with prop rotation right?.

  8. #18
    Wire Sofaking nescalona's Avatar
    Join Date
    Apr 2007
    Location
    Shoreline, Washington
    Posts
    1,299

    Default Re: applyTorque Tutorial

    You got it. To convert from an intrinsic vector (relative to E) to an extrinsic one, do this:
    matrix(E) * V
    To convert from an extrinsic vector to an intrinsic one (relative to E), do this:
    transpose(matrix(E)) * V

    Example:
    matrix(E) * vec(1,0,0) == E:forward()
    transpose(matrix(E)) * E:forward() == vec(1,0,0)

  9. #19
    Wirererer Tayg0's Avatar
    Join Date
    Aug 2008
    Posts
    144

    Default Re: applyTorque Tutorial

    Oh wow, thanks. I get it now. ^^

  10. #20
    I think I think too much -HP-'s Avatar
    Join Date
    Feb 2009
    Location
    Behind you with a very sharp knife.
    Posts
    2,466

    Default Re: applyTorque Tutorial

    Quote Originally Posted by Fizyk View Post
    That is a thing for a whole another tutorial I actually thought of making a tutorial on basic maths and physics to help people understand what they actually do, I might make one in the future.
    About cross, for now try this: Cross product - Wikipedia, the free encyclopedia


    Hmm, maybe you are right. I didn't think of wheels when making this tutorial.


    Oh right, the arrow is visible quite clearly and I didn't notice it might be hard to read the text. I might change that.

    Also, thanks for your positive feedback
    Look what I found
    Gah, stupid embedder
    [ame="http://www.youtube.com/watch?v=zA0fvwtvgvA#"]YouTube - Cross product 1[/ame]
    [ame="http://www.youtube.com/watch?v=o_puKe_lTKk#"]YouTube - Cross Product 2[/ame]
    [ame="http://www.youtube.com/watch?v=s38l6nmTrvM#"]YouTube - Cross Product and Torque[/ame]

    Not sure if they relate to this though, I couldn't be bothered to watch them through
    Last edited by -HP-; 08-24-2009 at 01:40 PM. Reason: removed the media tagging shit

+ Reply to Thread
Page 2 of 8 FirstFirst 1234 ... LastLast

Similar Threads

  1. Help with applyTorque
    By AndyDLP in forum Installation and Malfunctions Support
    Replies: 13
    Last Post: 11-16-2009, 12:55 AM
  2. Keep upright with applyTorque() function
    By OmicroN in forum Finished contraptions
    Replies: 2
    Last Post: 07-30-2009, 09:24 AM
  3. E2 Tutorial
    By goluch in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 8
    Last Post: 05-28-2009, 02:20 PM
  4. Pac's E2 Tutorial
    By Nicolai1 in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 27
    Last Post: 04-12-2009, 08:02 AM
  5. Putting a video tutorial in the gmod tutorial list
    By Def the world in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 08-21-2007, 10:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots