Page 18 of 67 FirstFirst ... 814151617181920212228 ... LastLast
Results 171 to 180 of 670

Thread: The LaserBoy Thread

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

    Default

    Thanks!

    I already figured out how to make the effects much more useful. So a new-er version is coming soon.
    Last edited by james; 12-12-2018 at 13:18.
    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.

  2. #172
    Join Date
    Jul 2008
    Posts
    768

    Default

    Can't seem to get this ild file to load in LB, but I can load it just fine in LWave...

    ftp://ftp.photonlexicon.com/PLFTP.le...Shows/geetone/

    I just noticed the 8/6/17 version loads the file OK.
    Last edited by dchammonds; 12-26-2018 at 19:05.

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

    Default

    Quote Originally Posted by dchammonds View Post
    Can't seem to get this ild file to load in LB, but I can load it just fine in LWave...

    ftp://ftp.photonlexicon.com/PLFTP.le...Shows/geetone/

    I just noticed the 8/6/17 version loads the file OK.
    Thanks for finding this and telling me about it.

    I got it. The current version of the code doesn't like the .ILD in capital letters. Fixing it now.

    Wow! I found a whole mess of bugs looking for that!

    Thanks!
    Last edited by james; 12-27-2018 at 08:33.
    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. #174
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default What were you doing at 0:00?

    I was looking at code! Happy New Year!
    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. #175
    Join Date
    Mar 2012
    Location
    Akron, Ohio USA
    Posts
    2,197

    Default

    Here's the results of a ridiculous amount of math.

    Enjoy.
    Attached Files Attached Files
    Last edited by james; 02-20-2019 at 20:37.
    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.

  6. #176
    Join Date
    Sep 2014
    Location
    Colorado USA
    Posts
    793

    Default

    Quote Originally Posted by dchammonds View Post
    Found this by freak accident- anyone heard of it?

    https://en.wikipedia.org/wiki/JUCE
    yup, slurp. I too, heard of it recently.
    ________________________________
    Everything depends on everything else

  7. #177
    Join Date
    Mar 2010
    Location
    Raleigh, NC
    Posts
    2,292

    Default

    Quote Originally Posted by lasermaster1977 View Post
    yup, slurp. I too, heard of it recently.
    I don't think I have heard of JUCE. So far I have stayed away from frameworks with weird macros and stuff.

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

    Default I broke math.

    In my most recent endeavors with LaserBoy I've been working a lot more with double precision floating point numbers for 3D coordinate math. The frame set I posted above actually has a specific purpose. The white outline around the 2D view of the vector art is an irregular convex polygon. And It has a point inside of it called its centroid. A centroid point can be calculated to be the same point regardless of the rotation of the polygon. This is much different than calculating a point that is half the height and half the width (rectangular center). Just consider the case of an equilateral triangle. If it's sitting on its base, half of its height is certainly not the rotational center of the shape. So if you want to rotate or scale an element in a frame, you have to have a reference point to do it from. If you simply multiple all the coordinate values by some number larger than one, the object will get bigger and it will also move away from the origin of space , the point {0, 0, 0}. But if you first subtract the centroid from all of the vertices, then do the multiplication, then add the centroid back to the vertices, the object will scale unto itself. The same applies to rotation. You have to pick at least two of the three values of x, y and z to define a line, parallel to an axis, to spin around.

    It is worth noting that a centroid is entirely a 2D concept. It is calculated by determining the area of the irregular polygon. This is done by breaking the irregular polygon into a set of triangles and adding all of them together. This area is then used in another calculation that averages all of the centroids of the triangles together.

    https://en.wikipedia.org/wiki/Centroid

    See the section "Of A Polygon".

    A polygon is a 2D entity. So I came up with the idea of using all three views of space, front, side and top, to find the 2D polygons, their areas and centroids and using that information to calculate a sort of 3D centroid. Each 2D view can contribute information about 2 of the coordinate's values (x, y) (z, y) & (x, z). The influence each view has on the 3D centroid point is weighted in the calculation based on the area of each view's polygon.

    A polygon is defined by no less than three non-co-linear points (at least a triangle). A single point has no area, nor does a line.

    All of this is factored into my calculation for the 3D centroid.

    Basically I take all of the coordinates of the vertices in a frame and reorder them in order of rotation around their rectangular center from zero to 2 pi radians (counter-clockwise). Then I find the point that is farthest away from the center and reorder the coordinates from that point as I know it must be on the outside of the polygon. The point set is still in order of rotation. Then I look at the angles made by starting at p1, going through p2 and on to p3. If that angle is zero to pi radians, then it forms a concave angle (pointing inward to the polygon) and I remove p2 from the set.

    I use the atan2 function in C++ and I define the special cases where p1, p2 or p3 might be the same point to be zero radians. (The atan2 function itself considers this situation to produce an out_of_range answer as it makes no sense).

    This is where it all falls apart in Windows.

    Even though I am using MinGW and GNU GCC as my compiler in Windows, by default, the way it processes floating point numbers in the CPU / FPU is significantly different in Linux than it is in Windows. I have to set switches in the g++ compiler instruction in the Makefile so that it knows to setup the CPU / FPU floating point mode and translate the C++ code to specific machine code instructions to do all of the math correctly.

    Linux does this by default. Windows does not. As one result (of many) all of the fp comparison operators like if(a < b) are completely unreliable and therefore useless. This issue is not at all associated with the GCC compiler. This odd behavior is the default for any compiler that runs in Windows.

    I don't know about you, but I think that's just nuts.

    James.
    Last edited by james; 03-06-2019 at 16:05.
    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. #179
    Join Date
    Mar 2010
    Location
    Raleigh, NC
    Posts
    2,292

    Default

    Quote Originally Posted by james View Post
    In my most recent endeavors with LaserBoy I've been working a lot more with double precision floating point numbers for 3D coordinate math. The frame set I posted above actually has a specific purpose. The white outline around the 2D view of the vector art is an irregular convex polygon. And It has a point inside of it called its centroid. A centroid point can be calculated to be the same point regardless of the rotation of the polygon. This is much different than calculating a point that is half the height and half the width (rectangular center). Just consider the case of an equilateral triangle. If it's sitting on its base, half of its height is certainly not the rotational center of the shape. So if you want to rotate or scale an element in a frame, you have to have a reference point to do it from. If you simply multiple all the coordinate values by some number larger than one, the object will get bigger and it will also move away from the origin of space , the point {0, 0, 0}. But if you first subtract the centroid from all of the vertices, then do the multiplication, then add the centroid back to the vertices, the object will scale unto itself. The same applies to rotation. You have to pick at least two of the three values of x, y and z to define a line, parallel to an axis, to spin around.

    It is worth nothing that a centroid is entirely a 2D concept. It is calculated by determining the area of the irregular polygon. This is done by breaking the irregular polygon into a set of triangles and adding all of them together. This area is then used in another calculation that averages all of the centroids of the triangles together.

    https://en.wikipedia.org/wiki/Centroid

    See the section "Of A Polygon".

    A polygon is a 2D entity. So I came up with the idea of using all three views of space, front, side and top, to find the 2D polygons, their areas and centroids and using that information to calculate a sort of 3D centroid. Each 2D view can contribute information about 2 of the coordinate's values (x, y) (z, y) & (x, z). The influence each view has on the 3D centroid point is weighted in the calculation based on the area of each view's polygon.

    A polygon is defined by no less than three non-co-linear points (at least a triangle). A single point has no area, nor does a line.

    All of this is factored into my calculation for the 3D centroid.

    Basically I take all of the coordinates of the vertices in a frame and reorder them in order of rotation around their rectangular center from zero to 2 pi radians (counter-clockwise). Then I find the point that is farthest away from the center and reorder the coordinates from that point as I know it must be on the outside of the polygon. The point set is still in order of rotation. Then I look at the angles made by starting at p1, going through p2 and on to p3. If that angle is zero to pi radians, then it forms a concave angle (pointing inward to the polygon) and I remove p2 from the set.

    I use the atan2 function in C++ and I define the special cases where p1, p2 or p3 might be the same point to be zero radians. (The atan2 function itself considers this situation to produce an out_of_range answer as it makes no sense).

    This is where it all falls apart in Windows.

    Even though I am using MinGW and GNU GCC as my compiler in Windows, by default, the way it processes floating point numbers in the CPU / FPU is significantly different in Linux than it is in Windows. I have to set switches in the g++ compiler instruction in the Makefile so that it knows to setup the CPU / FPU floating point mode and translate the C++ code to specific machine code instructions to do all of the math correctly.

    Linux does this by default. Windows does not. As one result (of many) all of the fp comparison operators like if(a < b) are completely unreliable and therefore useless. This issue is not at all associated with the GCC compiler. This odd behavior is the default for any compiler that runs in Windows.

    I don't know about you, but I think that's just nuts.

    James.
    Which compiler are you using? It has nothing to do with Windows. It has to do with the compiler.

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

    Default

    Like I said, I'm using GNU GCC with MinGW.

    It is not a situation created by the compiler. It is all about the default mode that Windows puts the CPU / FPU in when it prepares to run an application. It can however be over-ridden with a couple of instructions to g++ (the GNU C++ compiler).

    It has to do with floating point rounding conventions and the way the FPU deals with real numbers inside the processor (with so-called extended precision) and how it stores the results in the RAM.

    If you say something simple like double c = 3.0 / 7.0; and then expect to get true as the result of if(c == (3.0 / 7.0)) ... it fails!

    The reason it fails is because the FPU uses a different format in the registers than in the RAM. So they have different degrees of accuracy or resolution.

    Look it up!
    Last edited by james; 03-05-2019 at 17:09.
    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
  •