+ Reply to Thread
Results 1 to 10 of 10

Thread: Calculations and Exp2 question

  1. #1
    Wirererer jayg20769's Avatar
    Join Date
    Jun 2008
    Posts
    322

    Question Calculations and Exp2 question

    I've been having this fit on how to approach my new contraption and I need some help from you guy

    Question 1: The function ":eye" in Exp2, is it possible to retrieve this information from a player while he/she is in a vehicle WITHOUT using a targetfinder? Simply put, is it possible for the Adv. Pod controller to output this info thru Exp2 or do I need to do some calculations?

    Question 2: I know that subtracting 2 GPS coordinates would give you the FORWARD vector of whatever you are trying to track, but I can't seem to figure out how to calculate the left or right vector of a target, meaning:

    Target is ahead of me,

    I go right,

    -or-

    I go left,


    and whenever it tries to get infront of me I just go to the left or right (vague question I know )

    BTW the left or right thing, I choose which way to go, just cant figure out how to calculate it

  2. #2
    Wiremod Helper Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden
    Posts
    1,660

    Default Re: Calculations and Exp2 question

    Answer 1: The advpodcontroller got outputs as X Y Z, those are the coordinates where the guy is looking inside the vehicle.

    Answer 2: Try your way forward -.-, its 50% you will get right.

  3. #3
    Wirererer jayg20769's Avatar
    Join Date
    Jun 2008
    Posts
    322

    Default Re: Calculations and Exp2 question

    I wish it were that simple,

    Problem 1: I dont want a posistion vector, I want a direction vector, thats what ":eye" does

    Problem 2: there are 3 coordiates on a world plane, cutting it in half would just decrease its rate

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

    Default Re: Calculations and Exp2 question

    1. Subtract your position from the adv. pod XYZ and normalize, you will get the direction vector.
    2. You need more data to determine left and right, for example the up vector, which can be defined as (0,0,1). Then calculate cross product (direction x up) and you will get the right vector.

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

  5. #5
    Wirererer jayg20769's Avatar
    Join Date
    Jun 2008
    Posts
    322

    Default Re: Calculations and Exp2 question

    Thx so much for 1. but could you please describe the up vector and methods to getting it? thanks again

  6. #6
    Wirererer jayg20769's Avatar
    Join Date
    Jun 2008
    Posts
    322

    Default Re: Calculations and Exp2 question

    I tried 1. but Z doesn't respond when I look up (its always 0), only when I look down, does it's value change, and I still can't figure out that up vector

  7. #7
    Master of Mars Magos Mechanicus's Avatar
    Join Date
    May 2008
    Posts
    852

    Default Re: Calculations and Exp2 question

    Wirelink the expression to the pod controller. That lets you use Pod:entity():driver() and Pod:entity()assenger(), one of which will be the appropriate entity to use eye() on depending on what kind of vehicle you're using.
    You can also get the pod's right vector directly with Pod:entity():right(), but it will not turn with the mouse, only the pod. If you want that you'd have to use the cross product of eye() with Pod:entity():up().
    I can wire anything directly into anything! I'm the Professor!
    -Professor Hubert Farnsworth

  8. #8
    Wirererer jayg20769's Avatar
    Join Date
    Jun 2008
    Posts
    322

    Default Re: Calculations and Exp2 question

    Never mind, I figured out how to get the right vector, I just took the :eye and rotated it 90 degrees with

    Direction:rotate(0,90,0)

    Got me EXACTLY what I wanted, but thank you guys for the support and thanks so much Magos for telling me how to get eye from the pod

  9. #9
    Wirererer jayg20769's Avatar
    Join Date
    Jun 2008
    Posts
    322

    Default Re: Calculations and Exp2 question

    I tried both Pod:entity():driver():eye() and Pod:entity():Passenger():eye()

    but both of them aren't returning any values

    And I properly wirelinked them

    Im using the blue metal seat

  10. #10
    Wirererer jayg20769's Avatar
    Join Date
    Jun 2008
    Posts
    322

    Default Re: Calculations and Exp2 question

    Sry for bump, I really want to figure this out

    maybe I need an entity marker? (hope not)

+ Reply to Thread

Similar Threads

  1. Howitzer Calculations
    By poco642 in forum Installation and Malfunctions Support
    Replies: 15
    Last Post: 05-10-2010, 12:23 AM
  2. Where I have a mistake? [Exp2]
    By Klask in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 02-21-2009, 05:58 PM
  3. need some help with EXP2
    By KustoM in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 12-10-2008, 07:19 PM
  4. Wirelinks in exp2
    By Hitman271 in forum Installation and Malfunctions Support
    Replies: 5
    Last Post: 11-23-2008, 11:11 AM
  5. Epression Gate Calculations
    By Noctune9 in forum Bug Reports Archive
    Replies: 2
    Last Post: 08-19-2007, 01:53 PM

Tags for this Thread

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