Page 49 of 67 FirstFirst ... 3945464748495051525359 ... LastLast
Results 481 to 490 of 670

Thread: The LaserBoy Thread

  1. #481
    Join Date
    Sep 2014
    Location
    Colorado USA
    Posts
    793

    Default

    Quote Originally Posted by james View Post
    In your example, 3 and 5 are the amplitude. 0 and 90 are phase.

    It's worth noting that since this all gets scaled to fit inside of short integer space, the actual size of a figure is more or less irrelevant except when compared to other figures in the same space. Offset is also typically factored out unless you normalize with the origin. So there are literally an infinite number of ways to make the same final results.

    Not to mention that frequency is directly related to time, so different combinations of frequency and duration can also yield the same results.

    LBO(t) == amplitude * function(t * frequency + phase) * e ^ (-damping / t) + offset

    duty_cycle is a parameter that has no representation in the above expression. It actually changes the character of function. The value of duty_cycle must be between 0.0 and 1.0. A value of 0.5 is 50%. The sin function has 50% above and 50% below its zero value.

    In case you're wondering, Yes. I have had to scrape my brains off the ceiling several times while developing this code.

    I love that! New discoveries are what really drive me to keep working on this. And working with other people is the biggest reward.
    my bad, for being in a hurry. I meant
    x=sin(3x) + sin(5x), y=cos(3x) + cos(5x)
    for x = 0 to 360

  2. #482
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    Code:
    #math phase_cycle        360.0
    #math interval_cycle     1.0
    
    #math  start             0.0
    #math  duration          1.0
    math  iterations        1000
    
    # x = sin(t * 3) + sin(t * 5)
    # y = cos(t * 3) + cos(t * 5)
    # for t = 0 to two_pi
    
    math  LBO1 frequency    3.0
    
    math  LBO2 frequency    5.0
    
    math  LBO3 frequency    3.0
    math  LBO3 phase        90.0
    
    math  LBO4 frequency    5.0
    math  LBO4 phase        90.0
    
    # https://en.wikipedia.org/wiki/Harmonograph
    #    x = LBO1(t) + LBO2(t)
    #    y = LBO3(t) + LBO4(t)
    math  harmonograph
    
    math  render
    Last edited by james; 04-21-2021 at 07:49.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  3. #483
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    There are some other features in the new development version that are worth mentioning.

    If you go into the u menu for user interface visual attributes, you can now turn vector rendering on or off. This is the line between two consecutive vertices. With it off all you see are the vertices themselves.

    Also, in the [Tab] menu option 4 display settings, option 1 is rendered line width in pixels. So now you can make your vector lines as thick as you want.

    Set it to something like 4 to 7 and then load this:

    Code:
    #################################################
    #
    #   This file was written by James Lehman.
    #   creator of LaserBoy,
    #
    #   the free, multiplatform laser display
    #   application that reads this format.
    #
    #   <james@akrobiz.com>
    #   Extra Stimulus Inc., Akron, Ohio USA
    #   http://laserboy.org/
    #
    #   ASCII format version: LaserBoy-txt-04-21-2021
    #
    #################################################
    
    #math phase_cycle        360.0
    #math rotation_cycle     1.0
    #math interval_cycle     1.0
    
    math hues_span_factor   1.0
    math hues_shift         3
    
    math frames             1000
    
    math  start             0.0
    math _start             0.0
    
    math  duration          100.0
    math _duration          100.0
    
    math  iterations        96
    math _iterations        303
    
    math  LBO1  phase       90.0
    math _LBO1  phase       90.0
    
    #----------------------------------------------
    # https://en.wikipedia.org/wiki/Lissajous_curve
    #    x = LBO1(t)
    #    y = LBO2(t)
    math _oscillator_xy
    
    math  factor         0.0  0.0  0.0
    math  factor_        1.0  1.0  1.0
    math  scale_acceleration  0.0
    math  spread_scale
    
    math  color_span_hues
    math  reverse_vectors
    math  render
    
    ###############################################
    ###############################################
    After it's loaded, get back to the main menu and hit the ` key (just to the left of the digit 1 on the top row) to play the animation.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  4. #484
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    Click image for larger version. 

Name:	terminal.jpg 
Views:	3 
Size:	409.7 KB 
ID:	57871

    This is about right.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  5. #485
    Join Date
    Mar 2010
    Posts
    581

    Default

    Using the following code to generate the shape shown:


    math normalize_frames_with_origin no
    math normalize_frames_individually no
    math include_unit_reference no


    math to_frame 0.50


    # one oscillator
    math LBO1 phase 90.0
    math LBO1 amplitude 1.0
    math LBO2 amplitude 1.0
    math lissajou


    # another oscillator
    math LBO1 reset
    math LBO2 reset


    math LBO1 phase 90.0
    math LBO1 amplitude 0.5
    math LBO1 frequency -3.0


    math LBO2 amplitude 0.5
    math LBO2 frequency -3.0
    math lissajou


    # sum oscillators
    math add


    # output
    math render


    Now, instead of adding the two frame sets, how do I multiply both axes of one frame set with say, 20 percent of one axis in the other frame set?
    Attached Thumbnails Attached Thumbnails test_000.png  


  6. #486
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    Well there is a multiply operator that works about the same way add works. I'm not sure what your question is. There is a scale operator that works on a single frame_set. You have to set factor before you can scale. The parameter factor takes 3 values for x y z. And every vertex in a frame_set gets multiplied x to x y to y z to z. In a situation like this you really need to think about the order of your operations so you always know what is in the two registers. Remember multiplication is commutative so A * B == B * A.

    If you find that it's just not possible to keep the frame_sets of interest in the registers, you can store the last one added to the registers in a list and give it a name. Then later you can recall that name back into the registers.
    Last edited by james; 04-23-2021 at 14:48.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  7. #487
    Join Date
    Mar 2010
    Posts
    581

    Default

    I'll provide an illustration of what I consider the basics of generating cycloids, by way of using cyc. Perhaps because I have developed tools that deal with similar math but using a different approach, I'm having more difficulty than necessary by trying to do the same thing using LiquidMath.

    Error: the value in step 4 should be 80,000 not 8000.
    Attached Thumbnails Attached Thumbnails test_001.png  


  8. #488
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    See how that looks like a sin wave wrapped around the origin? There is a generator called polar that does that. It looks like your example has a frequency of 8 and an offset of 2.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  9. #489
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Smile

    It's probably best not to think of a LaserBoy_oscillator like a software version of an electronic oscillator. Think of it as a function that by default is the sin function. You define a portion of the real number line from start to start + duration, set your attributes of the LBOs you need and plot it in iteration steps over the interval by calling a generator. It's just like plotting on graph paper with a pencil and a calculator.
    Last edited by james; 04-23-2021 at 18:00.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

  10. #490
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    Code:
    math  to_frame          0.5
    
    math  LBO1  frequency   8.0
    math  LBO1  offset      2.0
    
    #     x = LBO1(t) * cos(t)
    #     y = LBO1(t) * sin(t)
    math  polar
    
    math  render
    Click image for larger version. 

Name:	greg.gif 
Views:	29 
Size:	3.0 KB 
ID:	57875

    Like I said in an email, this is one of those situations where it's so simple it's very complicated.
    Last edited by james; 04-23-2021 at 18:39.
    Creator of LaserBoy!
    LaserBoy is free and runs in Windows, MacOS and Linux (including Raspberry Pi!).
    Download LaserBoy!
    YouTube Tutorials
    Ask me about my LaserBoy Correction Amp Kit for sale!
    All software has a learning curve usually proportional to its capabilities and unique features. Pointing with a mouse is in no way easier than tapping a key.

Posting Permissions

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