- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经在 C# 中实现了行进立方体、双行进立方体和自适应行进立方体,结果发现我需要双重轮廓来实现我的目的。
我已经阅读了所有关于双等高线的作品,除了双等高线本身的核心之外,我获得了所有内容:最小化二次误差函数 (QEF)。
现在,我只是通过找到共享该单个顶点(3 到 6 个边)的所有边点之间的平均值来计算内部体素的顶点位置,并且效果很好,但显然它没有在正确的位置创建内部顶点。
这是我正在尝试创建的一段代码。任何帮助将不胜感激
/// <summary>
/// ORIGINAL WORK: Dual Contouring of Hermite Data by Tao Ju (remember me of a MechCommander 2 character)
/// 2.3 Representing and minimizing QEFs
/// The function E[x] can be expressed as the inner
/// product (Ax-b)T (Ax-b) where A is a matrix whose rows are the
/// normals ni and b is a vector whose entries are ni*pi. <------------ (dot product?)>
/// Typically, the quadratic function E[x] is expanded into the form
/// E[x] = xT AT Ax - 2xT AT b + bT b (2)
/// where the matrix AT A is a symmetric 3x3 matrix, AT b is a column
/// vector of length three and bT b is a scalar. The advantage of this expansion
/// is that only the matrices AT A, AT b and bT b need be stored
/// (10 floats), as opposed to storing the matrices A and b. Furthermore,
/// a minimizing value ˆ x for E[x] can be computed by solving
/// the normal equations AT Aˆ x = AT b.
/// </summary>
public Vector3 GetMinimumError(Vector3 p0, Vector3 p1, Vector3 p2, Vector3 n0, Vector3 n1, Vector3 n2)
{
//so, here we are. I'm creating a vector to store the final value.
Vector3 position = Vector3.Zero;
//Values of b are supposed to b (:P) three floats. The only way i know to find a float value
//by multiplying 2 vectors is to use dot product.
Vector3 b = new Vector3(
Vector3.Dot(p0, n0),
Vector3.Dot(p1, n1),
Vector3.Dot(p2, n2));
//What the transpose of a vector is supposed to be?
//I don't know, but i think should be the vector itself :)
float bTb = Vector3.Dot(b, b);
//i create a square matrix 3x3, so i can use c# matrix transformation libraries.
//i know i will probably have to build bigger matrix later on, but it should fit for now
Matrix A = new Matrix(
n0.X, n0.Y, n0.Z, 0,
n1.X, n1.Y, n1.Z, 0,
n2.X, n2.Y, n2.Z, 0,
0, 0, 0, 0);
//easy
Matrix AT = Matrix.Transpose(A);
//EASY
Matrix ATA = Matrix.Multiply(AT, A);
//Another intuition. Hope makes sense...
Vector3 ATb = Vector3.Transform(b, AT);
//...
// some cool stuff about solving
// the normal equations AT Aˆ x = AT b
//...
return position; //profit!
}
最佳答案
QEF 比较难理解。希望我能帮上忙。双轮廓法计算每个交叉点处的“Hermite”数据,或者换句话说,在体素边缘上创建的每个点处,表面的法线是已知的。用一个点和一个法线可以计算平面的方程。
QEF 是从体素的内部点到与体素相关联的每个平面的距离的平方和。下面是一些用于计算 QEF 的伪代码。
double get_QEF(Point3d point, Voxel3d voxel)
{
double QEF = 0.0;
foreach(plane in voxel.planes)
{
double dist_to_plane = plane.distance(point);
QEF += dist_to_plane*dist_to_plane;
}
return(QEF);
}
关于matrix-multiplication - 双重轮廓和二次误差函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16734792/
我正在尝试设计我的输入:文件。以下 SO 问题让我完成了 95% 的任务。区别在于我使用的是 HTML5 multiple=multiple 属性。 How to style "input file"
我一直在进行一项实验,其中多个调查参与者使用可穿戴技术聆听多首音乐来跟踪多条信息,两个例子是 BPM(心率)和 T(体温)。 目标是衡量每首音乐(以用户反馈为特征)对人类情感的影响。 目前,所有数据都
我使用 jquery 添加/删除输入 我使用append为日期/收入添加多个Tr 我还使用另一个附加来添加多个 td 以获取同一日期 Tr 中的收入 我添加多个日期输入,并在此表中添加多个收入输入 我
在 Android 中,有一种方法可以为项目中的所有模块生成签名的 APK。例如。我有以下项目 Project -- Library Module -- Module 1 -- Modul
我有一个用于网站展示的系统。 展览数据可能来自差异表中的多个数据。 喜欢这个设计: Table [ExhibitionType] used for differentiate category. Ta
关闭。这个问题是opinion-based .它目前不接受答案。 想要改进这个问题? 更新问题,以便 editing this post 可以用事实和引用来回答它. 关闭 8 年前。 Improve
我正在使用 UILocalnotification...收到通知时,当应用程序处于事件模式时我打开 viewcontroller...但是如果同时收到多个通知...我如何打开多个 viewcontro
我遇到的问题是一个策略浏览器游戏,它有 7 种类型的值。问题如下: 我在 $_POST 中获得了 7 个不同的值,包括从索引 unit_1 到索引 unit_7。这 7 个值是 0 到 20 之间的整
这个问题已经有答案了: Search Large Text File for Thousands of strings (3 个回答) 已关闭10 年前。 我想在多个文件上“grep”多个正则表达式。
我经常对如何在我的应用程序中解决这个问题感到矛盾。我使用了很多选项,包括: 一个通用的多选 - 这是我最不喜欢和最很少使用的选项。我发现可用性非常糟糕,一个简单的误点击就会毁了你所有的辛勤工作。 “自
以下是 couchbase 中的示例文档之一。 { "name":"abc", "friends":["a","b","c"], "bestfriends":["x","y","z"] }
我有 4 张 table 。 表组 | ID | NAME | 1 Premium 2 Silver 表用户 | ID | group_id | NAME | 1
我正在开发一个使用第三方服务(Facebook、Google 等)对用户进行身份验证的应用程序。我为每个用户提供一个内部 ID(uuid v4),该 ID 与他们的第 3 方 ID 相关联。现在,我的
我是 bicep 新手,一直在努力实现 Bicep 脚本来部署具有许多主题和订阅的 Azure 服务总线。 我添加的每个主题都有可变数量的订阅(例如,通知主题可能有 3 个订阅,但分析主题可能有 2
我是 bicep 新手,一直在努力实现 Bicep 脚本来部署具有许多主题和订阅的 Azure 服务总线。 我添加的每个主题都有可变数量的订阅(例如,通知主题可能有 3 个订阅,但分析主题可能有 2
我必须创建一个大型数据库。它将保存来自 100 多个设备的数据,并不断更新数据库。每 10 秒,每个设备都会更新数据库中的一行。是为每个设备数据建立一个单独的表还是将数据与设备 ID 放在同一个表中更
我需要在 Activity 开始时显示“正在加载”进度对话框,然后在加载完成后显示一些内容。在我的 onresume 中,我有类似这样的代码: loadThread = true; Thread sh
我有一个 html 表单 当我提交表单时,假设对于 id = 1,数量为 5 或 对于 id = 3,数量为 8。如何在java脚本或jquery中获取这些值并将这些信息提交到服务器?我
我正在创建一个 Mozilla 扩展程序,通过单击“转换按钮”(标签:转换)将网页内容转换为其他语言它的标签被转换为英文,以便单击该按钮(标签:英文)内容被转换为原始形式 我尝试为每个选项卡设置属性“
我正在尝试根据 进行搜索 我通过运行代码从 select 中获取值: for($i=0;$i= '$age_from' AND users.user_age = '$age_from' AND u
我是一名优秀的程序员,十分优秀!