游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2379|回复: 6

求与3D空间中16个已知点距离总和最近的平面?

[复制链接]

21

主题

230

帖子

230

积分

中级会员

Rank: 3Rank: 3

积分
230
发表于 2006-10-13 11:01:00 | 显示全部楼层 |阅读模式
RT.

21

主题

230

帖子

230

积分

中级会员

Rank: 3Rank: 3

积分
230
 楼主| 发表于 2006-10-13 11:21:00 | 显示全部楼层

Re:求与3D空间中16个已知点距离总和最近的平面?

实际是这样的。DXT1压缩算法里面。是把图片分成4X4的块。压缩后的结果是:每个块有颜色的最大值和最小值。每个象素的颜色是在大的和小的插值得到的。
每个象素2BIT,每个颜色16bit.

已知:p[4][4],maxcolor ,mincolor
解码过程是:
k= (maxcolor-minclor)/4;
pcolor[j]=mincolor+k*p[j];

现在我想压缩DDS的。我知道有许多库。但是我不想用。因为我要自己控制压缩每个块。
但是我没找到DDS压缩的代码。
每个颜色有 r,g,b,
已知:
CLOR[4][4].
然后我要怎样得到一个颜色的最大,最小。然后使得颜色的损失最小。
我知道搞图像的肯定有许多数学好的,帮我推导一下

89

主题

4036

帖子

4132

积分

论坛元老

Rank: 8Rank: 8

积分
4132
发表于 2006-10-13 12:14:00 | 显示全部楼层

Re:求与3D空间中16个已知点距离总和最近的平面?

最小二乘能做吗/

21

主题

230

帖子

230

积分

中级会员

Rank: 3Rank: 3

积分
230
 楼主| 发表于 2006-10-13 13:37:00 | 显示全部楼层

Re:求与3D空间中16个已知点距离总和最近的平面?

应该好像是的可以。
我还没想清楚。

89

主题

4036

帖子

4132

积分

论坛元老

Rank: 8Rank: 8

积分
4132
发表于 2006-10-13 13:40:00 | 显示全部楼层

Re:求与3D空间中16个已知点距离总和最近的平面?

这种都属于线性问题。最小二乘法应该都可以了。

21

主题

230

帖子

230

积分

中级会员

Rank: 3Rank: 3

积分
230
 楼主| 发表于 2006-10-13 14:24:00 | 显示全部楼层

Re:求与3D空间中16个已知点距离总和最近的平面?

问题好像应该是 3d空间与已知16点距离总和最小的直线。
最小二乘我见到到的是二维的。
我找了篇文章

http://www.sjbrown.co.uk/?article=dxt


The DXT Colour Block

DXT is a block compression scheme, where each block encodes a 4x4 set of pixels. Each block is compressed by picking a start and end colour at 565 precision (that is, 5 bits for red, 6 for green and 5 for blue) and considering up to two full-precision intermediate colours. Each pixel in the block is then encoded with a 2-bit index into these 4 colours.

This allows 16 pixels to be encoded in 8 bytes of data, giving either 6:1 or 8:1 compression (depending on whether you are including alpha).
Principle Components

Each colour in the block can be considered as a point in a 3-dimensional space of (red, green, blue). The compressed colours we use to represent this block must lie along a straight line through this space, the direction of which must well-capture the variation in the block.

A technique called principle component analysis can find the direction along which the points vary the most. This direction, called the principle axis, is likely to be very close to the direction of the line through the compressed endpoints, so we use this to bootstrap two different methods to find good endpoints.

5

主题

41

帖子

41

积分

注册会员

Rank: 2

积分
41
发表于 2006-10-13 18:17:00 | 显示全部楼层

Re:求与3D空间中16个已知点距离总和最近的平面?

这不是DXTn的压缩算法嘛!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-25 15:27

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表