Just follow along:
Easy one. This shows you how to assign textures and apply bump maps in blender.
So I have a list of names, but the names are duplicated down the page. Each name is on a new line by itself.
If I want to remove all the duplicates and just find out who is included in the file, I can simply do:
This will remove duplicates and print them to your terminal.
Well here’s the fix…
You have to replace the file. First get a UTF-8 output:
Then delete the file. Make a new file (already UTF-8 by default) and paste in the UTF-8 output from your terminal.
Let’s say you have an object that you’ve scaled already. You don’t want to keep having to scale it every time you copy it. You can normalize it by:
Ok folks, it doesn’t get easier than this. If you want to start writing shaders in the browser but can’t figure out how to create your shader program, ThreeJS has you covered:
In your JS
In your head:
So you have a dual screen setup and xscope keeps putting the guides on the wrong side.
Go to xscope –> preferences –> and select which screen guides should appear on:
scroll down and right
I never have time, so this will be quick.
Let’s say we want to find a pixel index amoung all that image data canvas returns with:
The formula is simple:
Basically, you need to draw this one out. Let’s say we have a 3×3 image. Each pixel would have it’s own zero based index. The width would be three. Each row would stretch from 0 – 2 and each column would stretch from 0 – 2.
Now let’s say we want to select the 7th pixel. We know the formula is:
index => (y * w + x)
So we can calculate the index by selecting Row 2 and Column 1. Just like battleship.
The only confusing part is why we should multiply by 4 at the end! It’s simple really, there are 4 values for every pixel (r,g,b,a).
To loop through and get the index for every pixel, might look something like:
Just wanted to post this. The source is pretty self explanatory and i’ll put up a github later once I clean up a few things.
I’ll explain later. Be patient, it takes a second to load.