-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
When a custom mesh is loaded using View3D1.Import3DModelAsync, and then subsequently changed from the scene, the model is changed into a BoxGeometry.
How to reproduce:
This can be reproduced simply using the examples.
- Modify
OnCreateCubeButtonClickin Example04.razor in the Blazor3D.Examples.WebAsm project, to Import a 3D model instead of creating a box.
I used the stl loading from Example02.razor and turnedOnCreateCubeButtonClickinto this:
private async Task OnCreateCubeButtonClick()
{
var settings = new ImportSettings
{
Format = Import3DFormats.Stl,
FileURL = "https://threejs.org/examples/models/stl/ascii/slotted_disk.stl",
};
lastCubeGuid = await View3D1.Import3DModelAsync(settings);
await View3D1.SetCameraPositionAsync(new Vector3(0, 3, 3), new Vector3(0, 1, 0));
msg = $"created new cube with id = {lastCubeGuid}";
StateHasChanged();
lastCubeGuid = Guid.Empty;
}- Run the app, go to Example04, click the
Create Cubebutton and see that it loads the STL corrctly. - Select the loaded model in the view, optionally modify the X, Y or Z values, and click `Update selected cube position"
Expected behavior
The model moves to the specified position
Actual behavior
The model moves and is now turned into a BoxGeometry.
I guess this happens because when the Mesh is accessed from the scene, by default it is a BoxGeometry, and View3D1.UpdateScene(); the replaces the loaded model with a BoxGeometry.
Is there any workaround for this, or am I just doing something completely wrong here 😄
Note: My goal is to load to meshes from stl, and and by using sliders, rotate them individually.
Metadata
Metadata
Assignees
Labels
No labels