cut texture in half at any angle on plane.

Is it possible to cut a texture in half or any angle. I have a project where I am getting cross section information from a microscope. All the crosssections are stacked together into a 3d-looking object.

I want to cut the cross sections – there are some unity3d tools for that, but I also want to cut the textures too.

Anybody have ideas on how to cut a texture in two on any angle?

Thanks for any ideas or suggestions.

Dan

Actually pretty simple. It has to do with a simple concept. Take 4 vertices… 0,0 - 1,0 - 0,1 - 1,1 Figure out where you want to slice it at… Add 2 vertices to the mix. Create the faces you need… the actual numbers are the texture vertices. Scale it as you need it and you have it.

I guess I need to read up on how textures work. Are you saying that each texture can be split up by the vertices I choose and mapped onto other objects-- like cutting stickers or labels? If so that’s great. Or have I got the concept wrong?

Thanks,

Dan

I can’t find any info on texture vertices. Can you provide a few more clues about what to look up or where to find it? Are you saying make a new mesh with new faces? and then apply the texture by somehow specifying the texture vertices?

Right now I’ve found lots of info about decals and getPixels but I don’t think that’s what you are talking about.

Thanks,

Dan

First… create a new mesh

Create vertices… based on a 1x1 block (values should be in each corner zero, zero to one, one

Calculate the new vertices… This is really however you are doing it, but the x, or y of that vertices MUST be on either one or zero. The other value is part of the cut.

Next comes figuring out which vertex(vertices) are not going to be used. So say, you have zero, zero, and your angle cuts off one, one… this still will leave you zero,one and one,zero as well as two vertices that you created.

Now, you will have (zero, zero), (one, zero), (zero, one), (one, one), (vertexX), (vertexY)

Now you create faces based on what you are using. Each face is a list of 3 integers which correspond to the number of a vertex.
(0, 1, 2), (2, 1, 4), (1, 5, 4)

yes, we are not using 3 beacuse it is an unused vertex.

Lastly, we update the UV’s. UV’s are texture coordinates that correspond to zero, zero to one, one… Since our triangle doesn’t exceed these measurements. then we can use the vertex X and Y as the U and V. Each vertex must have a UV. Each UV corresponds to a vertex.

The whole process is actually mathematical… you will have to look up triangle splitting or rectangle splitting. This will get you very close to the ball park of what you want.

Whew, I’m glad you responded.

Thank you so much for the information.
I think I can probably try something now.

Thanks again,

Dan