Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Get angle of wall

  1. #11
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts
    Now i'm confused. What do i have to do?
    I obv changed that + to *. I dont know how that happened

    //edit:
    After taking a look at my video again i realized something thats weird.
    On the third ramp (0.35) the print from
    Code:
    VectortoAngles(newPos["normal"])
    is (330,0,0)
    If i set the angles of the object directly to that value its the same as in the video and as you can see its wrong.
    If i set it to (0,0,330), its exactly as it should be.
    Why the hell is that shit basically mirrored? Is there something that i'm missing there?
    Last edited by DjTranceFire; 27th October 2016 at 22:54.

  2. #12
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Maybe BO3 has another coordinate system. Just try to flip the values in script, e.g.:


    PHP Code:
    tmputils\math::orientToNormal(newPos["normal"]+(0.01,0.01,0.01));
    tmp = (tmp[2], tmp[1], tmp[0]);
    bluePortal.angles tmp
    timescale 0.01

  3. The Following User Says Thank You to kung foo man For This Useful Post:

    DjTranceFire (30th October 2016)

  4. #13
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts
    https://www.youtube.com/watch?v=jRcodiPLwfs


    So with:
    Code:
    newangles = VectortoAngles(newPos["normal"]) + (0,90,0);
    orangePortal.angles = (newangles[2],newangles[1],newangles[0]);
    Its working as it should. Its flat to the walls and flat to the floor and ramps.
    Still weird that somehow x,y,z changed.
    With orientToNormal the portal is still rotated into all directions. The values doesnt seem to be correct is you can see in the prints.

    Now there are 2 problems left until the portal placement is done.

    1. Sometimes the portals are stuck inside of the wall. (Video at: 0.04)
    2. For some reason its sometimes not taking the direction that it should. (Video at: 0.25)
    You can see that when i place the portal on the ground, its 90° rotated.
    Obv. thats only the case if i look in that direction, if i turn myself 90° the Portal is correct.
    So it seems like its not using the direction the player is looking at.
    Last edited by DjTranceFire; 28th October 2016 at 12:13.

  5. #14
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    This should fix your in-wall stuff:
    PHP Code:
    placeportal(portalmodel)
    {
        
    trace bullettrace(self geteyepos(), self geteyepos() + vectorscale(anglestoforward(self getplayerangles()), 1000), falseundefined);
        if(
    trace["fraction"] < 1)
        {
            
    //actually place portal here
            
    portalmodel.origin trace["origin"] + vectorscale(trace["normal"], 0.01); //put it outside the wall
            
    portalmodel.angles vectortoangles(trace["normal"]);
            return 
    true;
        }
        return 
    false;

    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  6. The Following User Says Thank You to IzNoGoD For This Useful Post:

    DjTranceFire (30th October 2016)

  7. #15
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts
    Everything is working fine now, the only problem thats left, is the rotation of the model while placed on the floor/ceiling.
    Is there any chance to rotate the model on the floor with the player angle? (video at 0.25)

  8. #16
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Just check if normal[2] == 1 || normal[2] == -1

    Then use portal.angles = (0, player getplayerangles()[2], 0);
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •