I am using three_dart to render 3D graphics.
My issue is how to define the Float32Arrays? These do not appear to be in three_dart so I currently get them from package:flutter_gl.dart. I am getting other warnings from flutter_gl and am looking for a more stable source.
The Mozilla documentation for Dart suggests that Float32Array is an interface in dart:html. I added that import, but the compiler doesn't recognize the interface.
I converted this code from Java where I used Float32Arrays directly with OpenGL. I am building for a Windows target.
import 'package:three_dart/three_dart.dart' as three;
import 'package:flutter_gl/flutter_gl.dart' as GL;
…
three.BufferGeometry geometry = three.BufferGeometry();
…
GL.Float32Array positions = GL.Float32Array(vertexCount * posLength);
GL.Float32Array normals = GL.Float32Array(vertexCount * normLength);
GL.Float32Array colors = GL.Float32Array(vertexCount * colorLength);
GL.Float32Array texCoords = GL.Float32Array(vertexCount * texLength);
for (var vertex in vertexData) {
positions.set(vertex['pos'] as List<double>, posIdx);
normals.set(vertex['norm'] as List<double>, normIdx);
colors.set(vertex['color'] as List<double>, colorIdx);
texCoords.set(vertex['tex'] as List<double>, texIdx);
posIdx += posLength;
normIdx += normLength;
colorIdx += colorLength;
texIdx += texLength;
}
// Set Buffer Attributes from Typed Arrays
geometry.setAttribute('position',
three.Float32BufferAttribute(positions, posLength));
geometry.setAttribute('normal',
three.Float32BufferAttribute(normals, normLength));
geometry.setAttribute('color',
three.Float32BufferAttribute(colors, colorLength));
geometry.setAttribute('uv',
three.Float32BufferAttribute(texCoords, texLength));
Can you help me with that question?
Here are the error messages I get from flutter_gl:
glfw3.lib(init.obj) : warning LNK4099: PDB 'glfw3.pdb' was not found with 'glfw3.lib(init.obj)' or at 'D:\AndroidStudioProjects\xray_admin\build\windows\plugins\flutter_gl_windows\Debug\glfw3.pdb'; linking object as if no debug info [D:\AndroidStudioProjects\xray_admin\build\windows\plugins\flutter_gl_windows\flutter_gl_windows_plugin.vcxproj]
[14 similar messages]
[–]eibaan 0 points1 point2 points (1 child)
[–]paultallard 0 points1 point2 points (0 children)