Python Tip: User Scrolling

Just another quick tip.  Sometimes I create python to use as a demonstration. Here is an example:

This is a double pendulum (sorry for the lack of embeds – I hope to fix that soon).  But there is a problem when you use the code as an embedded demo.  What happens if a user is reading over a blog post using the scroll wheel?  If they mouse over the trinket embed and scroll, they will zoom out and not see anything.

You can fix this by adding the following:

Yes, just add scene.userzoom=False

That’s it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.