一文了解M-Tree(M树)

本文深入解析M-Tree,一种用于解决最近邻搜索和范围搜索问题的空间索引结构。内容涵盖M-Tree的背景、核心思路、结构、插入过程、分裂过程以及如何进行范围搜索。M-Tree利用圆形覆盖空间区域,减少搜索数据量,提高查询效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

概括

这篇博客分析了论文Indexing Metric Spaces with M-tree(后文简称M-Tree或M树),我将从以下几个方面介绍它:

  1. 背景
  2. M-Tree的结构
  3. M-Tree的插入
  4. M-Tree的分裂
  5. 如何使用M-Tree进行range搜索
  6. M-Tree的代码

背景

M-tree被设计为了解决最近邻搜索问题(NN)或范围搜索问题。以生活中的例子作为说明,最近邻搜索问题(NN)指的是,给定一个地理位置,在数据集中找到距离给定位置最近的目标(比如最近的饭店,最近的银行等等)。
范围搜索问题指的是,给定一个地理位置和搜索范围,在数据集中找到距离小于范围的所有目标。

M-Tree核心思路

M-tree使用圆形(二维情况)覆盖空间区域。每个圆涵盖了一部分数据所在的区域。对于查询目标,M-tree确定哪个圆和目标区域相交,若相交,则继续探测对应的圆。若不相交则滤除对应的圆,这意味着该圆涵盖的数据都不需要进行判断,减少了需要探测的数据量。本质上,M-tree从上到下就是一个大圆包含小圆的结构。
在这里插入图片描述

M-Tree的结构

在这一节分析如果构建M-tree。M-Tree使用圆来划分区域,因此每个结点存在一个圆心和一个半径。M-Tree的分为两类结点:内结点,叶结点。每个结点存储0~M个孩子结点。每个结点的多个属性我们用一个entry类来组织,不同类型的结点entry类是不同的:

内节点:它是包含了

  • entry ⁡ ( O r ) = [ O r , ptr ⁡ ( T ( O r ) ) , r ( O r ) , d ( O r , P ( O r ) ) ] \operatorname{entry}\left(O_{r}\right)=\left[O_{r}, \operatorname{ptr}\left(T\left(O_{r}\right)\right), r\left(O_{r}\right), d\left(O_{r}, P\left(O_{r}\right)\right)\right] entry(Or)=[Or,ptr(T(Or)),r(Or),d(Or,P(Or))]

O r O_r Or是结点圆心值,

Mtree is a powerful tree creation tool for the Unity editor. Nominated for best Artistic Tool 2019 Unity Awards. Every game needs vegetation, and while there are numerous vegetation packs for sale on the asset store, nothing beats the usefulness of having total control over the look and performance of the assets. Mtree will not only create beautiful looking vegetation, it will streamline your workflow by removing the need of modelling, unwrapping, importing your vegetation models from another software, and doing it all over again when you need to change a small detail. With Mtree, there will be less iterations over your models, and they will be quicker. Mtree trees are made in unity, for unity, the material is right, the dimensions are right, and everything is simple. Moreover, a good mesh is not enough in order to have a believable vegetation asset, you need a good shader, a good wind displacement solution, and vertex data to feed those; Mtree will answer every one of these needs. Mtree offers an intuitive, simple, yet complete solution for crafting AAA trees in a matter of minutes. With Mtree you can: • Create a trunk of any shape. • Add branches, grow them, split stem, add more branches. • Add leafs of any shape. • Bake the ambient occlusion in the vertex data. • Control the polygon count, get the most out of the fewest triangles. • Create Branches textures from a single leaf texture with the Branch Editor. • Save your finished tree as a prefab that is convenient to use. What Mtree will do for you: • Automatically create LOD levels. • Create and assign materials to the bark and leaves of your trees. • Make branches react to the colliders of your scene. • Create and render a billboard when you save the tree as prefab. • Bake the ambient occlusion when you save the tree as prefab. • Create vertex color data that will be used to drive the wind simulation and random color variation.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值