Port POV tools to Windows

It is pretty dark in here. Only lights from the computer monitors. I’ll try a bit more with reducing exposure, and turning everything off.

Turn down ISO and aperture maybe?

I did change the aperture from 2. something to 16, which helped a lot. I will try manipulate ISO next time.


exposure 2s
aperture 16
Iso 6400

I have a couple of ideas where i could play around with the numbers

2 Likes

into what?
What happens after the previous step " type “WSL” into the windows search and click that cheeky penguin" ?
Does it open a command prompt?

Sry.
Yes, it opens a WSL command prompt, which can actually take linux commands.

type “make” into the command prompt.
Guess my proof reading wasn’t the best there and I got lost mid sentence.

I tried creating a 72 POV image, by updating the Makefile file with a HEIGHT variable. Like so:

It freezes after a while. My guess is, that this is due to the 144 being a part of the pov.h.

Trying to change that value. And maybe make it dynamic as well? Any suggestions?

So my hunch was correct. Changing the value “144” in the pov.h file to the corresponding height stops it from freezing and everything works well.

My current solution is to have a variable pov_height inside the pov.h.

#include "shadowfoil_72_FC_POV_data.h"
int pov_height = 72;

I put it right next to the include of the desired POV_data file, because I would have to change that anyways.

What I am trying to do is optimize it for specific blades. In my case a 72 NPXL blade for my @shadowfoil Props / Phoenix Props “The Child” saber.

My thinking was: why let the board do the calculation while using it and having to scale down the data, when I can provide a correct size image.
Not sure if applicable but resizing images in the real world always looks worse than to create it in the desired size. But then again was the smaller image also scaled down by an algorithm in the first place.

Image (with the 144 height) for fun reasons. (Logo is mirrored unfortunately, Grogu approves anyways.)

Edit: Is there a way to extract the _X_ height value of the #include dynamicly, so that i don’t have to change that manually all the time? My spirit animal is a sloth.

These could be made into variables set by #defines in the main config file so pov.h doesn’t need to be edited.

Well, that is probably even more elegant. This is what I scribbled:

String pov_filename = "shadowfoil_72_FC_POV_data.h";
#include pov_filename;
int pov_height = 144;

int index_first_underscore = pov_filename.indexOf('_');
if (index_first_underscore != -1) {
	index_second_underscore = pov_filename.indexOf('_', index_first_underscore + 1);
	if (index_second_underscore != -1) {
		String pov_height_s = pov_filename.substring(index_first_underscore + 1, index_second_underscore);
		if(pov_height_s.toInt() != 0) {
			pov_height = pov_height_s.toInt();
		}
	}
}

Would this work for arduino?

It seems not:

In file included from F:\Saber\Software\ProffieOS\ProffieOS.ino:547:
F:\Saber\Software\ProffieOS\styles\pov.h:20:10: error: #include expects "FILENAME" or <FILENAME>
   20 | #include pov_filename;
      |          ^~~~~~~~~~~~
exit status 1
Error compiling for board Proffieboard V2.

So this is an example of the 72 height version. This time correctly aligned because the board was facing the right way (towards me)


exposure 2s
aperture 16
iso 400

it takes quite some tries to get the look you are aiming for. I found it yields better results to move the hand in an arc (like the windshieldwiper) than to just try to twist it in place.

pov_height should be handled the same way that image_color is in single-color pov data. Basically, pgmtorle/pnmtorle should just print out the relevant variable so that when you include the file you get the right height.

See here how it’s done for image_color:

@profezzorn is pnmtoblc a work in progress? This would be for “FromFile” things, yes?
It’s only mentioned in the pov_tools Makefile currently

I think I decided that pnmtoblc is just impractical and wrote videotoblc instead.
Not sure if I still have a copy of it somewhere or not.

Hi @profezzorn, thanks for the reply.
Unfortunately I am not sure I follow, how I am supposed to apply which part of image_color to pov_height and where.
So in the *pov_data.h we basically already have the height of the image, because it is created with the script that defines the height (default 144).
Now we only need to extract that out of the given POV file?
Is that correct?

No, the pov file doesn’t actually have the height in it, but we can fix that by making pnmtorle and pgmtorle put the height in the file. All it has to do is something like:

  printf("#define POV_DATA_HEIGHT %d\n", some_variable_that_has_the_height_in_it);

Then we don’t have to extract the height from the pov file, once included, we can just use POV_DATA_HEIGHT instead of 144 in pov.h

Sounds great! Begone magic numbers!

I was just looking at this.
Automatically getting the height would be ideal instead of needing to input it. (I was thinking y_size could be obtained from the top part of pgmtorle) ??

Then , it could be checked if >= 144 to just resize as usual. If < 144, use the file’s native height.

So, pnmwindshieldwiper scales the image, so it will be deciding the height. It cannot be done automatically. The image that pnmwindshieldwiper outputs will have the height specified in the header, so in pnmtorle / pgmtorle this will be image.xsize(), so the printout should simply be:

printf("#define POV_DATA_HEIGHT %d\n", image.xsize());

Ops, I meant image.ysize() I think…

1 Like