简体   繁体   English

3D等效位图(bmp)

[英]3D Equivalent of Bitmap (bmp)

In the same way that a bitmap (bmp) is just a 2 dimensional array of values representing white/black or color - is anyone aware of a similar type of "structure" for a simple 3 dimensional bitmap? 就像位图(bmp)只是表示白/黑或颜色的二维数组一样 - 是否有人知道一个简单的三维位图的类似“结构”类型? In other words, a 3 dimensional array of values representing black/white or color? 换句话说,表示黑/白或颜色的三维值数组?

It seems like there are a variety of problems that could potentially be solved relatively easily with such a "point cloud" type of structure. 看起来有很多问题可以通过这种“点云”类型的结构相对容易地解决。

In other words, without getting into the whole 3d rendering world, some problems seems solvable with a much simpler data structure, and far less math than is usually involved with managing 3d objects effeciently (using OpenGL, DirectX, Axiom, GDI+, etc). 换句话说,在没有进入整个3d渲染世界的情况下,一些问题似乎可以通过更简单的数据结构来解决,而且通常涉及有效管理3d对象(使用OpenGL,DirectX,Axiom,GDI +等)的数学要少得多。

I understand that this structure would not be "efficient" along a variety of vectors - but... it seems like there may be certain problems that would seem to lend themselves to such a "model" of a 3d object. 据我所知,这种结构在各种矢量上都不会“高效” - 但似乎可能存在一些似乎适合3d对象的“模型”的问题。

It would also be helpful to have an algorithm to generate such a point cloud from other 3d file types such as STL, Mesh, POV, BLEND, etc). 使用算法从其他3d文件类型(例如STL,Mesh,POV,BLEND等)生成这样的点云也是有帮助的。 Maybe one of these is already such a structure? 也许其中一个已经是这样的结构? (newbie) :) (新手):)

Any suggestions or information greatly appreciated. 任何建议或信息非常感谢。 Thanks in Advance. 提前致谢。

There is nothing preventing you from using a 3D array of numbers to store pixel data except the memory to store it. 没有什么可以阻止您使用3D数组来存储像素数据,除了存储它的内存。 Like this: 像这样:

struct Pixel {
    int Red;
    int Green;
    int Blue;
}

public Pixel[,,] myPix3D = new Pixel[300, 300, 300];

That is the "3D equivalent of Bitmap" 这就是“Bitmap的3D等价物”

OR, you could store each pixel and its location, to save memory. 或者,您可以存储每个像素及其位置,以节省内存。 This way you don't store anything for empty spaces in your object. 这样,您不会为对象中的空白存储任何内容。

struct Pixel {
    int Red;
    int Green;
    int Blue;
    double X;
    double Y;
    double Z;
}

If you had a very detailed 3D scan from something like an MRI or CAT scanner, these structures would be useful, and in fact a collection of 'slices' from such a scan is basically the same thing. 如果您从像MRI或CAT扫描仪那样进行非常详细的3D扫描,这些结构将是有用的,事实上,来自这种扫描的“切片”集合基本上是相同的。 Most of the time, we are only concerned with putting the visible pixels on the screen as fast as possible, and better structures exist for that, such as vector models, collections of triangles, etc. 大多数时候,我们只关心尽可能快地将可见像素放在屏幕上,并且存在更好的结构,例如矢量模型,三角形集合等。

Another way to store a 3D image, which is actually used quite often, is the depth-map. 另一种存储3D图像的方法是深度图,该3D图像实际上经常使用。 With each pixel, you store a value indicating how close it is to the "screen" or whatever your projection surface is, and in subsequent drawing operations, you skip any pixels that have greater depth than the current pixel, because it won't be visible. 对于每个像素,您存储一个值,指示它与“屏幕”的距离或投影表​​面的距离,并在随后的绘图操作中,您跳过任何深度大于当前像素的像素,因为它不会是可见。 (also called Z-buffering) (也称为Z缓冲)

Also please note, when we go through the process of actually rendering 3D objects, we DO create them in 3D space first - but we usually do not texture map those objects, so the "in memory" representation is temporarily the type of object you are talking about but a bitmap always contains all the pixels, and we don't always need that, so we don't render the solid object into 3D space, only the wire-frame. 还请注意,当我们经历实际渲染3D对象的过程时,我们首先在3D空间中创建它们 - 但我们通常不对这些对象进行纹理映射,因此“内存”表示暂时是您所使用的对象类型谈论但是位图总是包含所有像素,我们并不总是需要它,所以我们不会将实体对象渲染到3D空间,只渲染线框。 Most graphics engines apply textures AFTER that temporary 3D space has been projected to 2D, and many optimizations have been applied. 大多数图形引擎在将临时3D空间投影到2D之后应用纹理,并且已应用了许多优化。

You could use that middle step to create your points in 3D space, but it isn't efficient to do that when all we are interested in is rendering the 2D image. 您可以使用该中间步骤在3D空间中创建点,但是当我们感兴趣的是渲染2D图像时,这样做是没有效率的。 If you had some use for the 3D bitmap, it could easily be created from wireframe models which have been projected into 3D space. 如果你对3D位图有一些用处,可以很容易地从已经投影到3D空间的线框模型中创建它。

3D textures are supported natively by standard rasterization hardware and API's. 标准光栅化硬件和API本身支持3D纹理。 Note that "point cloud" doesn't refer to any kind of 3D raster -- instead, a point cloud is just an unstructured collection of points. 请注意,“点云”并不是指任何类型的3D光栅 - 相反,点云只是一个非结构化的点集合。

The most common problem with using a 3D data array is that it takes an awful lot of memory -- so much that the sheer size can make it slow to compute with, even if the data fits in available memory. 使用3D数据阵列最常见的问题是它占用了大量内存 - 即使数据适合可用内存,其庞大的大小也会使计算速度变慢。 There are ways to improve on this: I believe MIP maps are supported for 3D textures, and on the main processor side, octrees can be used to take advantage of sparse 3D data. 有一些方法可以改进:我相信MIP贴图支持3D纹理,而在主处理器端,八叉树可以用来利用稀疏的3D数据。

However, there are many applications where 3D arrays make sense and nothing else does. 但是,有许多应用程序,其中3D阵列是有意义的,没有别的。 For example, MRI data is naturally dense 3D information. 例如,MRI数据是自然密集的3D信息。

AFAIK there is no such a thing as a well-stablished raster 3D structural format. AFAIK没有一个完善的光栅3D结构格式。 While raster data is often used in modern graphics, it is limited to texture, bump maps and height fields; 虽然栅格数据通常用于现代图形,但它仅限于纹理,凹凸贴图和高度场; structure is always defined in vector terms. 结构始终以向量术语定义。

My bet is that the reason for this scenario is the data volume x model ratio, sometimes questionable in 2D, but clearly at a disadvantage in 3D. 我敢打赌,这种情况的原因是数据量x模型比率,有时在2D中有问题,但在3D中显然处于劣势。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM