Replies: 1 comment
-
Hi, I would personalty go for creating it with Blender since I'm not a big fan of the ShapeFactory but if you want to do it programmaticly, it's done here: One thing I'd like to mention here is that I think there is a misunderstood concerning the glb source usage. BUT a glTF file is basically a Json file with vectors datas, not an image containing every potentially useless pixel datas The scaling is just like for vector image files. So, in my personal opinion, complexifying your code with Submesh and TriangleIndices might not be the best choice compared to only have a sphere.glb in your res or assets. Even more since it's not much more consuming. Here is the And the one from a {
"asset" : {
"generator" : "Khronos glTF Blender I/O v1.6.16",
"version" : "2.0"
},
"scene" : 0,
"scenes" : [
{
"name" : "Scene",
"nodes" : [
0
]
}
],
"nodes" : [
{
"mesh" : 0,
"name" : "Sphere"
}
],
"meshes" : [
{
"name" : "Sphere",
"primitives" : [
{
"attributes" : {
"POSITION" : 0
},
"indices" : 1
}
]
}
],
"accessors" : [
{
"bufferView" : 0,
"componentType" : 5126,
"count" : 242,
"max" : [
1,
1,
1.0000001192092896
],
"min" : [
-0.9999999403953552,
-1,
-1
],
"type" : "VEC3"
},
{
"bufferView" : 1,
"componentType" : 5123,
"count" : 1440,
"type" : "SCALAR"
}
],
"bufferViews" : [
{
"buffer" : 0,
"byteLength" : 2904,
"byteOffset" : 0
},
{
"buffer" : 0,
"byteLength" : 2880,
"byteOffset" : 2904
}
],
"buffers" : [
{
"byteLength" : 5784,
"uri" : "data:application/octet-stream;base64,AAAAAL4Uez/CxUe+AAAAAPMENT/zBDW/AAAAANo5Dj8x21S/AAAAABXvwz5eg2y/AAAAAMTFRz6+FHu/AAAAAC69O7MAAIC/AAAAAMLFR76+FHu/AAAAABTvw75fg2y/AAAAANk5Dr8y21S/AAAAAPMENb/zBDW/AAAAADLbVL/ZOQ6/AAAAAF6DbL8X78O+AAAAAL8Ue7/BxUe+OuaYPb4Uez/SkDi+HfYVPl6DbD/0BLW+zbVZPjHbVD9RZgO/1YuKPvMENT90PSe/wumiPto5Dj9Lp0S/9QS1PhXvwz55glq/TCvAPsTFRz7392e/F+/DPi69O7Neg2y/TC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a/9///vvMENb8AAAC/RSPJvjLbVL9QI8m+z4uKvl6DbL/Wi4q+q0INvr8Ue7+uQg2+KuaYvb4Uez/QkDi+DvYVvl6DbD/0BLW+tbVZvjHbVD9QZgO/youKvvMENT9zPSe/temivto5Dj9Kp0S/4AS1vhXvwz53glq/PivAvsTFRz7492e/Au/Dvi69O7Nfg2y/PivAvsLFR77492e/4AS1vhTvw753glq/temivtk5Dr9Kp0S/youKvvMENb9zPSe/tbVZvjLbVL9QZgO/DPYVvl6DbL/0BLW+KuaYvb8Ue7/QkDi+HOxjNF6DbD8U78O+DvahNDHbVD/XOQ6/AgABABAAAgAQABEACgAJABgACgAYABkAAwACABEAAwARABIACwAKABkACwAZABoABAADABIABAASABMADAALABoADAAaABsABQAEABMABQATABQAAACkAA0AhQAMABsABgAFABQABgAUABUA8AAAAA0A8AANAA4ABwAGABUABwAVABYA8QDwAA4A8QAOAA8ACAAHABYACAAWABcAAQDxAA8AAQAPABAACQAIABcACQAXABgAEAAPAB4AEAAeAB8AGAAXACYAGAAmACcAEQAQAB8AEQAfACAAGQAYACcAGQAnACgAEgARACAAEgAgACEAGgAZACgAGgAoACkAEwASACEAEwAhACIAGwAaACkAGwApACoAFAATACIAFAAiACMADQCkABwAhQAbACoAFQAUACMAFQAjACQADgANABwADgAcAB0AFgAVACQAFgAkACUADwAOAB0ADwAdAB4AFwAWACUAFwAlACYAIwAiADEAIwAxADIAHACkACsAhQAqADkAJAAjADIAJAAyADMAHQAcACsAHQArACwAJQAkADMAJQAzADQAHgAdACwAHgAsAC0AJgAlADQAJgA0ADUAHwAeAC0AHwAtAC4AJwAmADUAJwA1ADYAIAAfAC4AIAAuAC8AKAAnADYAKAA2ADcAIQAgAC8AIQAvADAAKQAoADcAKQA3ADgAIgAhADAAIgAwADEAKgApADgAKgA4ADkANgA1AEQANgBEAEUALwAuAD0ALwA9AD4ANwA2AEUANwBFAEYAMAAvAD4AMAA+AD8AOAA3AEYAOABGAEcAMQAwAD8AMQA/AEAAO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gAugDIAMkAwgDBANAAwgDQANEAuwC6AMkAuwDJAMoAtACkAMMAhQDCANEAvAC7AMoAvADKAMsAtQC0AMMAtQDDAMQAvQC8AMsAvQDLAMwAtgC1AMQAtgDEAMUA0QDQAN8A0QDfAOAAygDJANgAygDYANkAwwCkANIAhQDRAOAAywDKANkAywDZANoAxADDANIAxADSANMAzADLANoAzADaANsAxQDEANMAxQDTANQAzQDMANsAzQDbANwAxgDFANQAxgDUANUAzgDNANwAzgDcAN0AxwDGANUAxwDVANYAzwDOAN0AzwDdAN4AyADHANYAyADWANcA0ADPAN4A0ADeAN8AyQDIANcAyQDXANgA1QDUAOMA1QDjAOQA3QDcAOsA3QDrAOwA1gDVAOQA1gDkAOUA3gDdAOwA3gDsAO0A1wDWAOUA1wDlAOYA3wDeAO0A3wDtAO4A2ADXAOYA2ADmAOcA4ADfAO4A4ADuAO8A2QDYAOcA2QDnAOgA0gCkAOEAhQDgAO8A2gDZAOgA2gDoAOkA0wDSAOEA0wDhAOIA2wDaAOkA2wDpAOoA1ADTAOIA1ADiAOMA3ADbAOoA3ADqAOsA6ADnAAQA6AAEAAUA4QCkAAAAhQDvAAwA6QDoAAUA6QAFAAYA4gDhAAAA4gAAAPAA6gDpAAYA6gAGAAcA4wDiAPAA4wDwAPEA6wDqAAcA6wAHAAgA5ADjAPEA5ADxAAEA7ADrAAgA7AAIAAkA5QDkAAEA5QABAAIA7QDsAAkA7QAJAAoA5gDlAAIA5gACAAMA7gDtAAoA7gAKAAsA5wDmAAMA5wADAAQA7wDuAAsA7wALAAwA"
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Hi,
Anybody could tell me what is the code to draw a basic colored sphere with a radius of X and a color Color.RED in Sceneform Maintained? Same question for a plane with dimensions WxL.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions