+ Reply to Thread
Results 1 to 7 of 7

Thread: Largest Component of a vector

  1. #1
    Wire Sofaking ahref's Avatar
    Join Date
    Jul 2008
    Posts
    520

    Default Largest Component of a vector

    Im trying to get the largest component of a vector and return it in a vector form

    eg. vec(1,2,3) would turn into vec(0,0,3)

    I am aware of max(V:x(),V:y(),V:z()) thats not what i want though.

    How do i do this?
    A-Z Materials - Released!!!!!!!

  2. #2
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: Largest Component of a vector

    3 if-statments, one for each axis, is the "only" way right now I guess.
    What do you need it for anyway?

  3. #3
    Wire Sofaking ahref's Avatar
    Join Date
    Jul 2008
    Posts
    520

    Default Re: Largest Component of a vector

    Scaling a Hologram between two points
    A-Z Materials - Released!!!!!!!

  4. #4
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: Largest Component of a vector

    Scaling between two points is a bit... vague.

    Code:
     A\
     \ \
      \ \
       \ \
        \ \
         \ \
          \ \
           \B
             
    
          
     A    /\
         /  \
        /    \
       /      \
      /        \
     /          \B
     """"""""""""
    If you need the first option, then you can make the height equal the distance between AB, create the holo at (A+B)/2 and make the holoangle (A-B):toAngle().
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  5. #5
    Wire Sofaking ahref's Avatar
    Join Date
    Jul 2008
    Posts
    520

    Default Re: Largest Component of a vector

    first option . I used mix(V1,V2,0.5) for the position. Haven't tried the angular part though.
    Last edited by ahref; 07-27-2009 at 07:54 AM.
    A-Z Materials - Released!!!!!!!

  6. #6
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,009

    Default Re: Largest Component of a vector

    Pulled this out of an E2 I'm working on:


    HoloAng=(VectorB-VectorA):toAngle()
    HoloPos=(VectorB+VectorA)/2
    HoloLength=VectorB:distance(VectorA)

    holoCreate(1,HoloPos,vec(),HoloAng,vec(255,0,0))
    holoScaleUnits(1,vec(HoloLength,2,2))
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  7. #7
    Wire Sofaking ahref's Avatar
    Join Date
    Jul 2008
    Posts
    520

    Default Re: Largest Component of a vector

    it was only the angle part i needed afterall. I was using atanr :S
    A-Z Materials - Released!!!!!!!

+ Reply to Thread

Similar Threads

  1. E2 Vector works perfectly, but Vector Thruster can't follow GPS.
    By vortexnl in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 05-01-2009, 02:56 AM
  2. Outputting a vector from expression to vector thruster
    By Paper Clip in forum Installation and Malfunctions Support
    Replies: 2
    Last Post: 10-16-2008, 04:37 AM
  3. Vector Thrusters and Vector Direction with a Pod
    By zentiger in forum Installation and Malfunctions Support
    Replies: 8
    Last Post: 09-26-2008, 12:01 AM
  4. Smaller component models
    By Lieutent Slappy Moose in forum Ideas & Suggestions
    Replies: 2
    Last Post: 06-19-2008, 05:07 AM
  5. A component allowing more player interaction
    By them in forum Ideas & Suggestions
    Replies: 19
    Last Post: 06-09-2007, 03:12 AM

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