+ Reply to Thread
Page 10 of 40 FirstFirst ... 8910111220 ... LastLast
Results 91 to 100 of 399

Thread: Expression Gate Documentation

  1. #91
    Wire Amateur Razara's Avatar
    Join Date
    Feb 2007
    Location
    Michigan, USA
    Posts
    64

    Default

    Also messed around with your vector funktion, NICE.
    Code:
    N@Vector test
    I@X1 X2 Y1 Y2 Z1 Z2
    O@Pitch Yaw Distance
    
    V1=vector(X2-X1, Y2-Y1, Z2-Z1)
    Pitch=(vecpitch(V1)>180?-360+vecpitch(V1):vecpitch(V1))
    Yaw=vecyaw(V1)-180
    Distance=veclength(V1)
    Will make a -180 to 180 pitch and yaw out of two points in space. And distance between them.[/b]
    Wow, you just solved the troubles I had with coming up with a working code like that for my turret, thank you so much!


    Syranide:
    For some reason my clamp function is not working properly.
    Code:
    N@Test
    I@A Reset
    O@C
    interval(1000)
    A->clk()->B+=1;;
    C=clamp(5,B,10)
    Reset->B=0;
    The clamp works for the lower limit since C at the lowest is 5, however the upper limit does not work since C goes past 10. Is there an error in my code perhaps?

  2. #92
    Wire Sofaking Shandolum's Avatar
    Join Date
    Apr 2007
    Location
    Europe -> Denmark
    Posts
    887

    Default

    You should see the vector calculations that I have made for my spacecraft, they are really something that I am proud of having made, since I have needed a new delta-pitch, -yaw, -roll with several of my creations. And Now I finally have them by the use of three GPSs.
    Everything can be improved upon. Nothing is Perfect.
    The only way to move forward, is to surpass what has already been done.
    Creator of many things.

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

    Default

    Wow, you just solved the troubles I had with coming up with a working code like that for my turret, thank you so much!
    Syranide:
    For some reason my clamp function is not working properly.
    Code:
    N@Test
    I@A Reset
    O@C
    interval(1000)
    A->clk()->B+=1;;
    C=clamp(5,B,10)
    Reset->B=0;
    The clamp works for the lower limit since C at the lowest is 5, however the upper limit does not work since C goes past 10. Is there an error in my code perhaps?[/b]
    "C=clamp(B,5,10)", is the proper syntax, and by the way.
    "A->clk()->B+=1;;" is the same as "A & clk()->B+=1;"

    You should see the vector calculations that I have made for my spacecraft, they are really something that I am proud of having made, since I have needed a new delta-pitch, -yaw, -roll with several of my creations. And Now I finally have them by the use of three GPSs.[/b]
    I bet they are, you seem to be really profficient with the expression gate

  4. #94
    Wirererer EntropyGuardian's Avatar
    Join Date
    Apr 2007
    Posts
    154

    Default

    ...
    Messed around some more:
    Code:
    N@Vector test 2
    I@X1 X2 Y1 Y2 Z1 Z2 Length
    O@DX DY DZ
    
    #First the vectors for the two GPS
    VA****= vector(X1, Y1, Z1)
    VB****= vector(X2, Y2, Z2)
    
    #Then making the vector
    V1****= vecsub(VA, VB) #Subtracting them
    
    #Now for the normalization of the vector
    V2****= vecnormalize(V1) #The normalized vector
    
    #Now to put it to good use (hoverdrive)
    V3****= vecsmul(V2, Length) #Length = distance in units the vector will be. Multiplying the normalized vector with the length.
    Destination = vecadd(V3, VA) #Adding the new vector to the original position (point of origin).
    DX****= vecx(Destination) #The X value for the destination
    DY****= vecy(Destination) #The Y value for the destination
    DZ****= vecz(Destination) #The Z value for the destination
    And now you have a good hover drive expression-gate that teleports you a set distance forward.
    This would be better if you could use the X Y Z values from the hover drive as the point of origin.[/b]
    Heh, maybe you can help me. In this thread [ http://www.wiremod.com/showthread.php?t=974 ] I was asking how to do something similar (before vectors) and came up with this mess:

    Code:
    N@Point Master
    I@X1 X2 Y1 Y2 Z1 Z2 F R U
    O@X3 Y3 Z3
    M = (Y2 - Y1) / (X2 - X1)
    D = sqrt((X2 - X1)^2 + (Y2 - Y1)^2)
    B = Y1 - M * X1
    X3R = R * ((Y2 - Y1) / D) + X2
    Y3R = -R * ((X2 - X1) / D) + Y2
    X3D = (F + D) * ((X2-X1) / D) + X1
    Y3D = (F + D) * ((Y2-Y1)/D) + Y1
    X3 = X3D + X3R - X2
    Y3 = Y3D + Y3R - Y2
    Z3 = Z2 + U
    That will give you, given two GPS points, and how much you want to move forward, right, and up (or reverse for the opposites), where that third point is relative to how the gps's are facing. It blatantly cheats to go up since it just really is working on the 2-D XY coordinate plane and hell if those formulae were going to get any longer by adding another set of coordinates.

    Apparently I took analytical geometry and cal 2 in college but I don't remember a drip of vector math.

  5. #95
    Wire Sofaking Shandolum's Avatar
    Join Date
    Apr 2007
    Location
    Europe -> Denmark
    Posts
    887

    Default

    Try checking my spacecraft. it includes both the things you seek.
    Everything can be improved upon. Nothing is Perfect.
    The only way to move forward, is to surpass what has already been done.
    Creator of many things.

  6. #96
    Wire Noob E_net4's Avatar
    Join Date
    Jul 2007
    Location
    Coordinate type not specified.
    Posts
    12

    Default

    I found an error on the Inputs and Outputs section:
    Code:
    # GOOD! Break will revert to 0 once Speed is less than 50
    Break = 0, Speed >= 50 -> Break = 0;
    The correct version is:
    Code:
    # GOOD! Break will revert to 0 once Speed is less than 50
    Break = 0, Speed >= 50 -> Break = 1;
    I just hope I'm right, as I'm new to "wiring". :/
    I don't make, I create.

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

    Default

    Ah, thank you, you are correct.

  8. #98
    Wirererer CBBP's Avatar
    Join Date
    Apr 2007
    Posts
    201

    Default

    Not real short how you would make a pulser from that internal clock. like.. how would I make it dance form 1 to 0 to 1 over and over.

  9. #99
    Wirererer Core Xii's Avatar
    Join Date
    May 2007
    Location
    Finland
    Posts
    393

    Default

    Code:
    O@Out
    first() -> interval(1000);
    clk() -> Out = !Out;
    Square pulse with length 1 sec.
    Grammar is the difference between "helping your uncle, Jack, off his horse" and "helping your uncle jack off his horse".

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

    Default

    Code:
    O@Out
    interval(1000);
    clk() -> Out = !Out;
    Just a little flaw Core Xii, it would only flip once (first() -> ... ;)
    And while I'm at it, IF you do not add inputs to the gate, you can also remove "clk() -> ... ;", but for all other uses it has to be there.

+ Reply to Thread
Page 10 of 40 FirstFirst ... 8910111220 ... LastLast

Similar Threads

  1. !!!OLD!!! Documentation of hi-speed devices
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 98
    Last Post: 02-10-2011, 07:41 PM
  2. !!!OLD!!! ZGPU Documentation
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 38
    Last Post: 11-29-2010, 04:54 PM
  3. !!!OLD!!! ZCPU Documentation
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 144
    Last Post: 09-05-2010, 03:46 AM
  4. Moongate Documentation
    By BlackNecro in forum Wiremod Addons & Coding
    Replies: 24
    Last Post: 04-22-2009, 01:32 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