0

I am attempting to apply one solid texture to a quadtree but I am having a problem. How my quadtree works is by creating a new mesh each time there is a subdivision. So the tree starts as one mesh, then when it splits its 4 meshes, so on so forth.

Now I am trying to apply a consistent texture to quadtree where each split still draws the same texture fully. The pictures below give a good example

Before Split: enter image description here

After Split: enter image description here

What I want is the texture to look like the before split picture even after the split. I can't seem to figure out the UV-mapping for it though. Is there a simple way to do this?

I have tried taking the location and modifying it's value based on the scale of the new mesh. This has proven unfruitful though and I'm really not sure what to do.

Any help is advice is greatly appreciated, thanks.

CMilby
  • 624
  • 1
  • 6
  • 23

1 Answers1

0

Stumbled on this...so it might be too late to help you. But if you are still thinking about this:

I think your problem is that you are getting a little confused about what a quadtree is. A quadtree is a spatial partition of a space. Think of it as a 2 dimensional b-tree. You don't texture a quadtree, you just use it to quickly figure out what lies within an arbitrary bounded region.

I suppose that you could use it to determine texture offsets for texture alignment, but that sounds like an odd use of a quadtree, and I suspect that there is probably a much easier way to solve your problem. (Perhaps use the world space coords % texture size to get the offset needed to seamlessly render the texture across multiple triangles?

Roger Hill
  • 3,677
  • 1
  • 34
  • 38
  • I was attempting to make procedurally generated planets and was using large images to texture it at the time. I agree this was an odd way to do it and it was not how I ended up doing it, it just seemed like a good idea at the time. ( I ended up using simplex noise to generate textures ) – CMilby Jan 26 '17 at 04:18