hjoykim / THREE

c# port of Three.js
MIT License
141 stars 24 forks source link

Treejs glft problem #57

Open merco opened 4 days ago

merco commented 4 days ago

hello I have a question that goes beyond the threejs porting.

In my file format (a zip with the individual mesh geometries inside and then a json for matrices and positioning)

I'm trying to save the individual geometries in glft.

I think that the gltf optimization changes the base coordinates of the vertices and therefore the subsequent positionings are all wrong. Here's what happens by loading only the instances, without rotations and positionings.

Those with gltf all appear "normalized" on the origin, while the other vertices maintain their original positions.

How can I reposition the vertices (manipulated I think by the gltf optimizer) in order to use the matrices saved in my file?

Geometry saved from "obj"... manteins the "vertex coordinates"

immagine

Geometry optimized with gltf ... seems 0,0 based

immagine

merco commented 4 days ago

Using threejs editor, https://threejs.org/editor/ (or also https://playcanvas.com/model-viewer) it loads single meshes in the original right position: why? (but I can't get a normalized positioning that way)

immagine

Here the first 3 meshes singleMEshes.zip

this is a screenshot about the legacy viewer and no matrix

immagine

merco commented 4 days ago

This is my javascript and testmodel file

[Uploading input_test.zip…]()

merco commented 4 days ago

... it runs well only if I use the main "scene" node from the "loader.parse". I was trying to use the internal mesh of the scene node.... I don't know if it could worsen the performance...