Jump to content
Hash, Inc. Forums


Hash Fellow
  • Content Count

  • Joined

  • Last visited

  • Days Won


Posts posted by robcat2075


    Chapter 22 Arrays

    Sample project for Arrays

    • Declare an array of 8 elements
    • Make a loop that will fill each array element with a random number of 0-100
    • Make a loop that will print out all the elements on one line. Use "\t" to tab-space them.

    Add-on challenges

    • Make a loop that will print out the squares of each number on the next line
    • Make a loop that will print the square root of each element on the next line. (may need to #include <math.h> for sqrt())
    • Make a loop that will print the largest perfect square that would fit in each number on the next line. For example, if the random number is 56 the largest perfect square in that is 49. If the random number is 63, 49 is still the largest perfect square. But if the random number is 65 then 64 is the largest perfect square.
    • Make a loop that will print the the sum of each number + the number in the array element that precedes it.


    A typical run might look like this...

    Rands           4       19      99      62      25      9       49      17
    Squared         16      361     9801    3844    625     81      2401    289
    Sq rts          2       4.3589  9.94987 7.87401 5       3       7       4.12311
    Lrg Sqr         4       16      81      49      25      9       49      16
    Sum             4       23      118     161     87      34      58      66






    Sample BREAK project

    Write a FOR loop that will print 10 random integers... but uses BREAK to exit the loop prematurely if one of the integers is a 5


    Sample CONTINUE project

    Add a FOR loop like the above that prints 10 random integers... and also shows them multiplied by 10.

    Use CONTINUE to merely skip the multiply-by-10 step for numbers that are equal or greater than 5 instead of prematurely ending the loop.


    Sample run

    Loop Ended!
    3 times 10 is 30
    2 times 10 is 20
    3 times 10 is 30
    2 times 10 is 20
    1 times 10 is 10
    3 times 10 is 30




  3. I thought of a significant difference...

    Sprite  "size" is always a uniform scaling of their sprite image. They never get fat or skinny.

    Streaks have a "thickness" but instead of a length they have a "duration". The length of a streak depends on how fast it is traveling. Faster streaks are longer and if they stop moving they disappear entirely.

    That would be the major quality that neither can imitate of the other.


  4. I was hoping for the mysterious stranger!


    Sprites have many more possibilities in the properties.

    Do streaks render faster? Or use less memory?

    You should try setting up a test to compare the two. You'd probably have to set the emission rates very high to see a difference, like 100,000.

  5. I am surprised to only notice now that streaks can't cast shadows! I presumed they had that option but they don't.

    If I had to have streaks cast shadows I would do it with compositing...

    • Make a render with everything set to black except the streaks set to white, shot from the vantage point of the light. This will look like white particles on black.
    • apply that render to the light to project it on the scene. Render from the regular camera view with all objects to white, turn off streaks, turn off all other lights. This will look like white lights crawling on otherwise unlit surfaces. This is your streak shadow buffer.
    • Render the scene normally to OpenEXR format and composite the streak shadow buffer with the OpenEXR shadow buffer to combine the shadow information. This compositing could be done in an A:M Composite project or in something like After Effects.

    This is sort of how Z-buffered shadows work anyway


    However it is probably easier to fashion a small sprite that looks like a streak and use Sprites instead 😃

  6. 57 minutes ago, Michael Brennan said:

    Hi Chuck,

    I see that you were asking about Police Officer models, I don't have any at the moment...
    but it made me curious to ask, is there a Repository of models, materials and scenes for A:M?
    I have a bunch of old models I'd be willing to share if their was a place to upload them to?



    That would be fabulous, Michael!

    We have sub forum of Free Models donated by users (maybe there is a policeman in there?) etc.

    Start a thread in it with a descriptive title so others may find it in a search and upload your stuff!

    If you have model that uses bitmaps or other externals, it is best to put the model and its assets all in one ZIP and upload the zip.

    It is also helpful to post a small render of item in the thread.


    • Like 1

  7. Most of your scene... characters, models, lights... doesn't care about gravity.

    Particles do. Bullet objects do. Cloth does. Dynamic bones do.

    But that's about it.

    Now that I think about it, you can leave the Chor gravity at its default and negate it in the properties of the Fluid material!


  8. 8 minutes ago, Tom said:

    Do you think that is possible to make a blob (or other particle or sprite) stick to a vertical surface?

    Try setting the gravity in the Chor to a horizontal direction.  + or - X instead of -Y

  • Create New...