Jump to content

Create Point That Lasts Only One Frame, At Random Time Intervals [SOLVED]


Recommended Posts

Hello Houdini vex wizards!

I'm having a lot of difficulty trying to come up with a solution for this one myself.

As the title mentions, I'd like a single point to be created for just one frame and then disappear again - I would also like this to happen at random time intervals as the frame number increases.
For example the point will flash on for 1 frame, then maybe nothing for 10 frames, or nothing for 2 frames, then another point flash and so on.

I'm not very good with time related things in vex, but would love to learn more about random time stuff if anyone has any ideas?

Edited by GlennimusPrime
Link to comment
Share on other sites

You could use a switch sop with your point plugged into the first input and a null plugged into the second input.

Then an expression in the switch like:

rand($F)>0.1

Which will make the point appear on roughly one out of every 10 frames.

Edited by PixelNinja
Link to comment
Share on other sites

11 hours ago, GlennimusPrime said:

Beautiful! This is exactly the sort of control I was after, thank you @Ziyad!

Thanks for your input too @PixelNinja, although this method does not keep the point active for just one frame at a time.

Apologies, the expression should have been greater than rather than less than. I edited the original response.

Note that this doesn't explicitly stop a point appearing on sequential frames, though that is unlikely for small chance values. A value of 0.1 means the point will appear on roughly 1 out of every 10 frames.

Just posting this for completeness as a simpler counterpoint to the vex approach.

 

 

image.png.bf07014e34cf4003b5cc7ac9f65b75c9.png

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...