帮助3D网格 [英] Help with a 3D Grid\

查看:66
本文介绍了帮助3D网格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!!


我只是一个C / C ++中的dummie,我需要你帮助解决我的小问题b $ b问题。 />

我必须创建一个3D网格点。每个点都有3个坐标

和一个布尔值。 (我制作了一个结构来制作这个)。


我的任务是通过x,y和z平面扫描网格。


根据你的说法,这是创建这种数据结构的最佳方法吗?


我试图创建一个矢量点向量的向量

结构,所以访问每个点坐标我只需要做

喜欢:


网格[i] [j] [k] .x


所以i索引会给我x / $
飞机上的所有积分....


但我现在已经知道如何构建它了!

有没有人有任何线索?!


非常感谢


Vito Baldassarre

解决方案

Guardiano del Faro写道:


我只是一个C / C ++的dummie,我需要你帮助解决我的小问题。


我必须要创建一个3D网格点。每个点都有3个坐标

和一个布尔值。 (我制作了一个结构来制作这个)。


我的任务是通过x,y和z平面扫描网格。


根据你的说法,这是创建这种数据结构的最佳方法吗?


我试图创建一个矢量点向量的向量

结构,所以访问每个点坐标我只需要做

喜欢:


网格[i] [j] [k] .x


所以i索引会给我x / $
飞机上的所有积分....


但我现在已经知道如何建立它!



如何构建什么?


有人有任何线索吗?!



扫描网格是什么意思?如果积分在整个XYZ空间任意

的位置,那么它们都不能保证

有任何特定的x或y或z坐标(与你的
一致)
飞机)。否则,如果你有i,j,k _和_ x,y,z的每一点,

那么你没有三维空间(网格),你有六个

尺寸并且正在使用它的一部分(超平面),每个我或者j或者k
...


你不喜欢我们似乎已经清楚地了解了所需要的内容,或者是什么,这是阻碍你解释它的语言障碍

更好。也许如果你告诉我们你正在解决什么问题,那么

会更容易提出建议。作为替代方案,请考虑将b $ b发布到comp.graphics.algorithms新闻组。他们每天处理

空格和积分。


V

-

请删除资本''A'在通过电子邮件回复时

我没有回复最热门的回复,请不要问


< blockquote> Guardiano del Faro写道:


你好!!


我只是一个C / C ++中的dummie我需要你帮助解决我的小问题。


我必须创建一个3D网格点。每个点都有3个坐标

和一个布尔值。 (我制作了一个结构来制作这个)。


我的任务是通过x,y和z平面扫描网格。


根据你的说法,这是创建这种数据结构的最佳方法吗?


我试图创建一个矢量点向量的向量

结构,所以访问每个点坐标我只需要做

喜欢:


网格[i] [j] [k] .x


所以i索引会给我x / $
飞机上的所有积分....


但我现在已经知道如何构建它了!

有没有人有任何线索?!


非常感谢


Vito Baldassarre



尝试使用typedef为bool的向量创建一个替代名称,然后

然后执行对于那种类型的矢量也一样。

-

NOUN:1。遗嘱遗留给他人的金钱或财产。 2.从祖先或前任或过去那里下来的东西:b
宗教自由的遗产。 ETYMOLOGY:MidE legacie,副手办公室,来自OF,来自ML legatia的
,来自L legare,以及deute,遗赠。 www.bartleby.com/61/




Guardiano del Faro在留言中写道

< 11 ******************* ***@42g2000cwt.googlegroups。 com> ...


> Hello !!
我只是一个C / C ++中的dummie,我需要你帮助解决我的小问题
问题。
我必须创建一个3D网格点。每个点都有3个坐标
和一个布尔值。 (我做了一个结构来制作这个)。
我的任务是通过x,y和z平面扫描网格。
根据你的说法,这是创建这个数据结构的最佳方法?
我试图创建一个矢量点矢量结构的向量,所以要访问每个点坐标我只需要这样做:

Grid [i] [j] [k] .x
所以i索引会给我x />平面上的所有点....
但我现在已经知道了如何构建它!!!
有人有任何线索吗?!
非常感谢
Vito Baldassarre



// #include< iostream>,< vector>

// ------------------------------ ------

void TriVector(std :: ostream& cout){

typedef std :: vector< std :: vector< std :: vector< int vec3d;

vec3d vec3D(3,std :: vector< std :: vector< int(3,

std :: vector< int>(3,int( 7))));


for(size_t x(0); x< vec3D.size(); ++ x){

for(size_t y(0); y< vec3D.at(X).size(); ++ y){

for(size_t z(0); z< vec3D.at(x).at(y).size(); ++ z){

cout<<" vec3D.at(QUOT;<< X<<")在("<< Y<<")在("<< Z<<")=

<< vec3D.at(x).at(y).at(z)<< std :: endl;

vec3D.at (x).at(y).at(z)= x + y + z;

cout<<" vec3D.at(QUOT;<< X<<")在("<< Y<<")在("<< Z<<")=

<< vec3D.at(x).at(y).at(z)<< std :: endl;

} // for(z)

} // for(y)

cout<< std :: endl;

} // for(x )

cout<< std :: endl;

return;

} // TriVector(std :: ostream&)

// ------------------------------------

int main(){

TriVector(std :: cout);

返回0;

}


-

Bob R

POVrookie


Hello!!

i''m just a dummie in C/C++ and i need you help for solving my little
problem.

I have to create a 3D grid of points. Each point has the 3 coordinates
and a boolean value. (I made a structure in order to make this).

My task is to scan the grid through the x, y and z planes.

According to you, which is the best way to create this data structure?

I have tried to create a vector of vectors of vectors of point
structure, so to access to each point coordinate i just have to do
like:

Grid[i][j][k].x

So the i index will give me all the points which are on the x
planes....

but i have now idea about how to build it!!!
Does anybody has any clue?!

Thank you very much

Vito Baldassarre

解决方案

Guardiano del Faro wrote:

i''m just a dummie in C/C++ and i need you help for solving my little
problem.

I have to create a 3D grid of points. Each point has the 3 coordinates
and a boolean value. (I made a structure in order to make this).

My task is to scan the grid through the x, y and z planes.

According to you, which is the best way to create this data structure?

I have tried to create a vector of vectors of vectors of point
structure, so to access to each point coordinate i just have to do
like:

Grid[i][j][k].x

So the i index will give me all the points which are on the x
planes....

but i have now idea about how to build it!!!

How to build what?

Does anybody has any clue?!

What does it mean "to scan the grid"? If points are in arbitrary
positions throughout the XYZ space, none of them is guaranteed to
have any particular x or y or z coordinate (coincident with your
plane). Otherwise, if you have i,j,k _and_ x,y,z of every point,
then you don''t have a 3-dimensional space (grid), you have six
dimensions and are working with a subset of it (hyperplane) for
every i or j or k...

You don''t seem to have a clear understanding of what''s required or
it''s the language barrier that is stopping you from explaining it
better. Perhaps if you told us what problem you''re solving, it
would be easier to suggest something. As an alternative, consider
posting to ''comp.graphics.algorithms'' newsgroup. They deal with
spaces and points every day.

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask


Guardiano del Faro wrote:

Hello!!

i''m just a dummie in C/C++ and i need you help for solving my little
problem.

I have to create a 3D grid of points. Each point has the 3 coordinates
and a boolean value. (I made a structure in order to make this).

My task is to scan the grid through the x, y and z planes.

According to you, which is the best way to create this data structure?

I have tried to create a vector of vectors of vectors of point
structure, so to access to each point coordinate i just have to do
like:

Grid[i][j][k].x

So the i index will give me all the points which are on the x
planes....

but i have now idea about how to build it!!!
Does anybody has any clue?!

Thank you very much

Vito Baldassarre

Try using typedef to create an alternative name for the vector of bool, and
then do the same for a vector of that type.
--
NOUN:1. Money or property bequeathed to another by will. 2. Something handed
down from an ancestor or a predecessor or from the past: a legacy of
religious freedom. ETYMOLOGY: MidE legacie, office of a deputy, from OF,
from ML legatia, from L legare, to depute, bequeath. www.bartleby.com/61/



Guardiano del Faro wrote in message
<11**********************@42g2000cwt.googlegroups. com>...

>Hello!!
i''m just a dummie in C/C++ and i need you help for solving my little
problem.
I have to create a 3D grid of points. Each point has the 3 coordinates
and a boolean value. (I made a structure in order to make this).
My task is to scan the grid through the x, y and z planes.
According to you, which is the best way to create this data structure?
I have tried to create a vector of vectors of vectors of point
structure, so to access to each point coordinate i just have to do
like:
Grid[i][j][k].x
So the i index will give me all the points which are on the x
planes....
but i have now idea about how to build it!!!
Does anybody has any clue?!
Thank you very much
Vito Baldassarre

// #includes<iostream>, <vector>
// ------------------------------------
void TriVector( std::ostream &cout ){
typedef std::vector<std::vector<std::vector<int vec3d;
vec3d vec3D(3, std::vector<std::vector<int(3,
std::vector<int>(3, int(7))));

for(size_t x(0); x < vec3D.size(); ++x){
for(size_t y(0); y < vec3D.at(x).size(); ++y){
for(size_t z(0); z < vec3D.at(x).at(y).size(); ++z){
cout<<" vec3D.at("<<x<<").at("<<y<<").at("<<z<<")= "
<<vec3D.at(x).at(y).at(z)<<std::endl;
vec3D.at(x).at(y).at(z) = x+y+z;
cout<<" vec3D.at("<<x<<").at("<<y<<").at("<<z<<")= "
<<vec3D.at(x).at(y).at(z)<<std::endl;
} //for(z)
} //for(y)
cout<<std::endl;
} //for(x)
cout<<std::endl;
return;
} //TriVector(std::ostream&)
// ------------------------------------

int main(){
TriVector( std::cout );
return 0;
}

--
Bob R
POVrookie


这篇关于帮助3D网格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆