Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

qt - How to add 2D surface to a QML Scatter3D

I want to add a 2D surface of a static image to a 3DScatter graph as shown below.

enter image description here

I can achieve this using QCustom3DVolume. However my app uses OpenGL ES and QCustom3DVolume's documentation explicitly says that it does not support OpenGL ES environments.

I have also tried creating a simple cubic obj mesh file, load it using QCustom3DItem and set its textureFile property to my desired image. However there seems to be no way to scale the texture image to fit the item size as shown below.

enter image description here

original image:

enter image description here

mesh file:

# WaveFront *.obj file (generated by Autodesk ATF)

mtllib 5eb607c1-f53f-4cb4-b0b6-7d334249fcd3.mtl

g Body1

v 0.000000 0.000000 0.000000
v 0.000000 -1.000000 0.000000
v 0.000000 -1.000000 1.000000
v 0.000000 0.000000 1.000000
v 1.000000 0.000000 0.000000
v 1.000000 0.000000 1.000000
v 1.000000 -1.000000 0.000000
v 1.000000 -1.000000 1.000000
vt -0.000000 0.000000 0.000000
vt 0.100000 0.000000 0.000000
vt -0.000000 0.100000 0.000000
vt 0.100000 0.100000 0.000000
vt -0.000000 0.000000 0.000000
vt 0.100000 0.000000 0.000000
vt -0.000000 0.100000 0.000000
vt 0.100000 0.100000 0.000000
vt 0.000000 0.000000 0.000000
vt 0.100000 0.000000 0.000000
vt 0.000000 0.100000 0.000000
vt 0.100000 0.100000 0.000000
vt 0.000000 0.000000 0.000000
vt 0.100000 0.000000 0.000000
vt 0.000000 0.100000 0.000000
vt 0.100000 0.100000 0.000000
vt -0.050000 -0.050000 0.000000
vt 0.050000 -0.050000 0.000000
vt -0.050000 0.050000 0.000000
vt 0.050000 0.050000 0.000000
vt -0.050000 -0.050000 0.000000
vt 0.050000 -0.050000 0.000000
vt -0.050000 0.050000 0.000000
vt 0.050000 0.050000 0.000000
vn -0.100000 0.000000 0.000000
vn -0.100000 0.000000 0.000000
vn -0.100000 0.000000 0.000000
vn -0.100000 0.000000 0.000000
vn 0.000000 0.100000 0.000000
vn 0.000000 0.100000 0.000000
vn 0.000000 0.100000 0.000000
vn 0.000000 0.100000 0.000000
vn 0.100000 0.000000 0.000000
vn 0.100000 0.000000 0.000000
vn 0.100000 0.000000 0.000000
vn 0.100000 0.000000 0.000000
vn -0.000000 -0.100000 0.000000
vn -0.000000 -0.100000 0.000000
vn -0.000000 -0.100000 0.000000
vn -0.000000 -0.100000 0.000000
vn 0.000000 0.000000 0.100000
vn 0.000000 0.000000 0.100000
vn 0.000000 0.000000 0.100000
vn 0.000000 0.000000 0.100000
vn -0.000000 0.000000 -0.100000
vn -0.000000 0.000000 -0.100000
vn -0.000000 0.000000 -0.100000
vn -0.000000 0.000000 -0.100000
usemtl Steel_-_Satin
f 1/1/1 2/2/2 4/3/3
f 4/3/3 2/2/2 3/4/4
f 5/5/5 1/6/6 6/7/7
f 6/7/7 1/6/6 4/8/8
f 7/9/9 5/10/10 8/11/11
f 8/11/11 5/10/10 6/12/12
f 2/13/13 7/14/14 3/15/15
f 3/15/15 7/14/14 8/16/16
f 3/17/17 8/18/18 4/19/19
f 4/19/19 8/18/18 6/20/20
f 7/21/21 2/22/22 5/23/23
f 5/23/23 2/22/22 1/24/24

# 8 vertices
# 24 texture params
# 24 normals
# 12 facets

# 1 groups

Is there any other way to achieve this?

question from:https://stackoverflow.com/questions/65891996/how-to-add-2d-surface-to-a-qml-scatter3d

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...