f-log

just another web log

27 Feb 2021:
laser projection spot lights video
Here is a quick video on using Spot Lights in Blender to create laser scanning simulations and to project images on Meshes.

Uses my free Human Skull model



The line scanning animation plays at the beginning and then again at the end of the video. The first instance took just under two hours and full resolution, the one at the end with volumetric lighting took just under two days!

There will be another Skull video to come ... stay tuned
21 Feb 2021:
skull a003 sees the light of day
Quick update on the skull situation. Had to stop myself continually adding to the mountain of animations showing off the sculpt.

3D human skull sculpt
Rob on Earth text on Skull
montage of iterations during sculpt life-cycle

I will do some follow up videos on how I got the line laser effect (and logo projector effect) and a set of scripts that rendered all the iterations with different matcaps.

Video

20 Feb 2021:
poke a pico video mess
So when I found out how to get my new Pico working with the Pixel 3 and after finding no information about the process, creating a video was the logical conclusion (for me).

Creating videos is not easy or straight forward. I do not have any lighting or cameras set up and I had no idea how to record the Pixel's screen.

To start with I wedged my Go Pro Hero camera into a cardboard box, that had been weighed down with a bag of flour. Recording myself plugging in the Pico to the phone. As per any shoot, there were numerous takes.

Then I found that I could add the built-in option to record my phone screen and export the result to a external SD card. Again, numerous takes.

Windows has a built in record mode and this got the Chrome footage. Sadly, it refuses to record the File Explorer, so I took new video of my plugging an unplugging the Pico into a USB hub (that wasn't connected to anything, Hollywood smoke and mirrors).

I found my old posting for getting the Snowball Blue USB microphone working and just had to tweak it to be a module and not a kernel module built-in.

Then record the 22 voice clips that matched my basic script. Mucked about with Normalising and Amplifying the audio in Audacity and then dealing with the clipping issues. In the end I gave up and just ran Effects/Amplify on each recording and ignored the minor clipping, it did not seem to cause any pops or clicks.

The real fun was in Blender and it took me best part of a day to edit it all together. Nothing too major, but I haven't done any video editing in a while and I could not remember any of the short cuts. I did notice that setting the colour strips behind the code looked fine in the preview window, but were it totally the wrong place when rendered as a test at 25%. Worked fine in the final render at 100%.
20 Feb 2021:
put a pi pico into an android for repl
Long story short, I got two of the new Raspberry Pi Pico boards, as they were only a couple of quid each.

I have plan, but more on that another day. Today I wanted to just get them working and there is a great way I have seen other YourTubers doing with the interactive REPL.

You can download MicroPython directly on to the Pico and then interface with it via serial USB and type commands. Including the code to turn the LED on the Pico on and off.

Can I do this with my Android Google Pixel 3 phone?

According to Google and YouTube no one has ever tried (successfully). So I decided to make a video, because I could and yes you can use a Pico with an Android phone, sort of.



Script:

Can you get your Raspberry Pi Pico working with an Android phone ?
Yes, but it depends
If you plug the Pico into a Phone in USB mode, Android will report the drive as not formatted.
Unfortunately following the formatting steps does not fix this, but it will also not damage your Pico.

So grab a computer, I will be using Windows, but it should be similar on Mac and Linux.

To start we need to get Micropython running on the Pico
Head over to the Raspberry Pi Web site
https://www.raspberrypi.org/
https://www.raspberrypi.org/products/
https://www.raspberrypi.org/products/raspberry-pi-pico/
scroll down to to Documentation
https://www.raspberrypi.org/documentation/pico/getting-started/
and download the MicroPython UF2 file from the "Getting started with MicroyPython" section.

Now hold down the BOOTSEL button on the Pico and connect it to your computer, let go of the button and you should see a new Mass Storage device.
Simply copy over the UF2 file you downloaded and you are finished with the computer, disconnect the Pico.

Connect the Pico to your phone, this time do NOT hold down the BOOTSEL button
Go to the Google Play store and install "Serial USB Terminal" by Kai Morich. There are other USB serial apps, but this is the one that I tried and worked for me.
Open the app and go to settings/devices and click the Custom device, no driver, select CDC and say yes to the prompt about access to FS device

you are now connected to the REPL, a Read-Eval-Print-Loop and you can type commands
type print('hello') and click the send arrow.
The Python environment on the Pico will now answer hello.

I recommend writing commands in notes or another text editor and then copying and pasting them into the app rather than trying to type them each time.
you can now turn the LED on the Pico on with some code

from machine import Pin
led = Pin(25, Pin.OUT)
led.value(1)

and off again with

led.value(0)

This code and many other examples are available at the raspberry pi Pico MicroPython page

Hope this has been helpful

In the future you should be able to plug your Pico directly into your phone and use it as a mass storage device, bypassing the need of a separate computer.

06 Feb 2021:
vr update super half beat alyx hot sabre
Quick VR update.

Haven't managed to get Half life: Alyx Add-ons to work, yet.

Kids bought Beat Sabre and to say that that game gives you a work out is a huge understatement. Not something I would have chosen, but now I have played it I understand the hype.

Got a large piece of paper to cover the mirror and now VR is perfect.

Still play Super Hot VR regularly especially the Christmas mode. Could do with some more content.

I need to get around to importing the TopBlock Unreal project into VR, but I am currently working on the next Skull.
06 Feb 2021:
retro referential integrity bomb
Oops, I forgot to be Referentially Integral.

I created a simple Sqlite3 database for a project at work and I always wanted to go back and add Referential Integrity, but then forgot about it.

I had not done Referential Integrity with Sqlite3 before, having only experienced it via Microsoft's GUI tools. The reason I had not started with it, which of course I should have and now will do for future projects, is that the design was very fluid. I was playing with ideas, columns were changing names, types, being added deleted, it was a mess. Eventually it settled and has been running unchanged for about 10 months.

Then disaster struck. The hosting provider implemented rate limiting for all SSH connections without warning anyone. My code happily handled NO NETWORK, but here the network was returning weird error messages and only occasionally. Not knowing why I was getting the messages and wanting to just try again later led to some sub-optimal exception handling that led to database records being out of sync. Previously, if I tried to download a file I got that file, because to get that far the network had to be up. I had a load of records that stated they had downloaded a physical file when, in fact they had not.

I then had to re-engineer my remote access code and add retries and connection pooling. It worked, but was a major overhaul.

Because of the lack of previous Referential Integrity I was not sure how I could safely delete or reset the affected database records. Referential Integrity to the rescue, except I did not know if all the existing data was Referential Integrity valid.

Luckily I found this great tutorial that handled adding Referential Integrity to EXISTING DATA. There were lots of tutorials about adding Referential Integrity to new databases, but not for converting existing.

The steps it describes are pretty straight forward, but I did a lot of testing before I let them anywhere near my data.

1. Backup your data
ALTER TABLE table RENAME TO table_old;

2. Recreate your table with the Referential Integrity constraint/s

3. Enable Referential Integrity
PRAGMA foreign_keys=On;

4. Insert your old data into the new table
INSERT INTO table SELECT * FROM table_old;

If all your data is valid (from a Referential Integrity point of view) then that's it, job done. And it was for me. Huge sigh of relief.

If you get an error about Referential Integrity then you need to either

Disable Referential Integrity
PRAGMA foreign_keys=Off;
and re-insert, knowing the data is BAD

or

Fix your data and try again.

Lesson learned, don't try and retro-fit Referential Integrity :(
loading results, please wait loading animateloading animateloading animate
[More tags]
rss feed

email

root

flog archives


Disclaimer: This page is by me for me, if you are not me then please be aware of the following
I am not responsible for anything that works or does not work including files and pages made available at www.jumpstation.co.uk I am also not responsible for any information(or what you or others do with it) available at www.jumpstation.co.uk In fact I'm not responsible for anything ever, so there!