Creating grids and aligning them with uploaded .STLs
I've created a program that takes in an .STL file input, gets the corresponding URL for the object from the filestream, and renders it with Blazor3D. I'm trying to then add a new GridHelper, whose dimensions are relative to the size of the object rendered, something like GridHelper(Object.Length*2). I thought I had found the correct source for the rendered object's dimensions in the scene's child's Objects.Mesh.Geometry, however since it's a mesh, all of the dimensions are the default values (1,1,1), even if two meshes are vastly different in size.
My question is, is there a way I can find an 'absolute size' or another metric to handle things like varied grid size or camera location?
Also, this technically isn't the same issue, but whenever I try to rotate one of the meshes, it becomes a cube instead of staying as a mesh. Is there a way to avoid this?
My question is, is there a way I can find an 'absolute size' or another metric to handle things like varied grid size or camera location?
Hi. When you load the stl or any other file type, no info is supplied from JS to .NET side. Please, see https://github.com/HomagGroup/Blazor3D/issues/30 for more info.
Also, this technically isn't the same issue, but whenever I try to rotate one of the meshes, it becomes a cube instead of staying as a mesh. Is there a way to avoid this?
I have never seen such behavior before. are you trying to rotate programmatically?
Also, this technically isn't the same issue, but whenever I try to rotate one of the meshes, it becomes a cube instead of staying as a mesh. Is there a way to avoid this?
I have never seen such behavior before. are you trying to rotate programmatically?
if (e.Key == "w") { keyPressMessage = "W key held down"; scene.Children.Last().Rotation.X += 3; View3D1.UpdateScene(); }
Yes, I have code like this for each of the rotation directions. Is this not the intended way?
there are 2 moments:
- when you load the stl file, information about geometry is NOT sent to the .NET side. so, your c# code knows nothing about current geometry. the default cube geometry is created instead
- when you use View3D1.UpdateScene(), the scene from .NET part is converted to JSON, then it is sent to JS part. then js scene is cleared and recreated using sent JSON. So, you have default cube geometry instead of loaded file
unfortunately, the current state of the Blazor3D doesn't provide functionality required by you