Android 3D 曲面图

发布于 2024-12-28 07:50:30 字数 275 浏览 2 评论 0原文

我的要求是从数据点 (xyz) 值列表创建 3d 曲面图(还应显示 xyz 轴)。3d 可视化应在 ANDROID 上完成。

我的输入:目前计划使用 open gl 1.0 和 java。我还在考虑使用 open gl 1.0 的 Adore3d 、 min3d 和 rgl 包。擅长java,但3d编程新手。
时间范围:2个月

我想知道最好的方法是什么? opengl 1.0 适合 3d 曲面绘图吗?还有其他可以与 Android 一起使用的软件包/库吗?

My requirement is to create a 3d surface plot(should also display the x y z axis) from a list of data points (x y z) values.The 3d visualization should be done on ANDROID.

My Inputs : Currently planning on using open gl 1.0 and java. I m also considering Adore3d , min3d and rgl package which uses open gl 1.0. Good at java ,but a novice at 3d programming.
Time Frame : 2 months

I would like to know the best way to go about it? Is opengl 1.0 good for 3d surface plotting?Any other packages/libraries that can be used with Android?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

失去的东西太少 2025-01-04 07:50:30

那么,您可以使用 OpenGL 1.0 或 OpenGL 2.0 绘制曲面。您所需要做的就是将轴绘制为直线并将曲面绘制为三角形。如果你有高度场数据,你会这样做:

float[][] surface;
int width, height; // 2D surface data and it's dimensions

GL.glBegin(GL.GL_LINES);
GL.glVertex3f(0, 0, 0); // line starting at 0, 0, 0
GL.glVertex3f(width, 0, 0); // line ending at width, 0, 0
GL.glVertex3f(0, 0, 0); // line starting at 0, 0, 0
GL.glVertex3f(0, 0, height); // line ending at 0, 0, height
GL.glVertex3f(0, 0, 0); // line starting at 0, 0, 0
GL.glVertex3f(0, 50, 0); // line ending at 0, 50, 0 (50 is maximal value in surface[])
GL.glEnd();
// display the axes

GL.glBegin(GL.GL_TRIANGLES);
for(int x = 1; x < width; ++ x) {
    for(int y = 1; y < height; ++ y) {
        float a = surface[x - 1][y - 1];
        float b = surface[x][y - 1];
        float c = surface[x][y];
        float d = surface[x - 1][y];
        // get four points on the surface (they form a quad)

        GL.glVertex3f(x - 1, a, y - 1);
        GL.glVertex3f(x, b, y - 1);
        GL.glVertex3f(x, c, y);
        // draw triangle abc

        GL.glVertex3f(x - 1, a, y - 1);
        GL.glVertex3f(x, c, y);
        GL.glVertex3f(x - 1, d, y);
        // draw triangle acd
    }
}
GL.glEnd();
// display the data

这会绘制简单的轴和高度场,全部为白色。从这里扩展它应该非常简单。

Well, you can plot the surface using OpenGL 1.0 or OpenGL 2.0. All you need to do is to draw the axes as lines and draw the surface as triangles. If you have your heightfield data, you would do:

float[][] surface;
int width, height; // 2D surface data and it's dimensions

GL.glBegin(GL.GL_LINES);
GL.glVertex3f(0, 0, 0); // line starting at 0, 0, 0
GL.glVertex3f(width, 0, 0); // line ending at width, 0, 0
GL.glVertex3f(0, 0, 0); // line starting at 0, 0, 0
GL.glVertex3f(0, 0, height); // line ending at 0, 0, height
GL.glVertex3f(0, 0, 0); // line starting at 0, 0, 0
GL.glVertex3f(0, 50, 0); // line ending at 0, 50, 0 (50 is maximal value in surface[])
GL.glEnd();
// display the axes

GL.glBegin(GL.GL_TRIANGLES);
for(int x = 1; x < width; ++ x) {
    for(int y = 1; y < height; ++ y) {
        float a = surface[x - 1][y - 1];
        float b = surface[x][y - 1];
        float c = surface[x][y];
        float d = surface[x - 1][y];
        // get four points on the surface (they form a quad)

        GL.glVertex3f(x - 1, a, y - 1);
        GL.glVertex3f(x, b, y - 1);
        GL.glVertex3f(x, c, y);
        // draw triangle abc

        GL.glVertex3f(x - 1, a, y - 1);
        GL.glVertex3f(x, c, y);
        GL.glVertex3f(x - 1, d, y);
        // draw triangle acd
    }
}
GL.glEnd();
// display the data

This draws simple axes and heightfield, all in white color. It should be pretty straight forward to extend it from here.

暖心男生 2025-01-04 07:50:30

关于您问题的第二部分:

还有其他可以与 Android 一起使用的软件包/库吗?

是的,现在可以使用 SciChart 绘制 Android 3D 曲面图。

可以进行许多配置,包括绘制线框、渐变颜色地图、等高线和实时更新。

Android 3D Surface Plot

披露,我是 scichart 团队的技术主管

Re the second part of your question:

Any other packages/libraries that can be used with Android?

Yes, it's now possible to draw an Android 3D Surface Plot with SciChart.

Lots of configurations are possible including drawing wireframe, gradient colour maps, contours and real-time updates.

Android 3D Surface Plot

Disclosure, I'm the tech lead on the scichart team

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文