Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange model angle #27

Closed
435352980 opened this issue Sep 30, 2019 · 13 comments
Closed

Strange model angle #27

435352980 opened this issue Sep 30, 2019 · 13 comments

Comments

@435352980
Copy link

Some model angles are incorrect when combining models

Real behavior
39EEF7EDAF089E78057737209A3E3D90
Use viewer
81DB52D012DCA5399B832B7541751032

Hat
014E8738-2D8A-4E5F-9D9F-E6EAD6E9EEDA

@flowtsohg
Copy link
Owner

When you write combining, do you mean setParent()?
Does it happen with all models? looks like the axes are wrong, maybe I regressed something.
If it doesn't happen with all models, care to give me an example?

@435352980
Copy link
Author

Yes, I use setParent() to add model to attachment
Not with all models.

      for (const config of [wing, helmet, jewelry]) {
        if (config) {
          const { modelName, location } = config;
          const attachment = attachments.find(attachment => attachment.name === location);
          if (attachment) {
            const attachModel = await model.viewer.load(`${modelName}.mdx`, pathSolver).whenLoaded();
            const attachInstance = attachModel.addInstance();
            attachInstance.setSequenceLoopMode(2);
            attachInstance.dontInheritScale = false;
            attachInstance.setParent(instance.nodes[attachment.objectId]);
            scene.addInstance(attachInstance);
            attachInstance.setSequence(
              attachModel.sequences.findIndex(seq => seq.name.toLowerCase().includes('stand')) || 0
            );
          }
        }
      }

It's not easy to describe it. Sorry, Here is the project that i use to test.
twrpg-model-test.zip
Source code is in src/App.tsx.
Run npm install && npm run dev and then open http://localhost:8898 in the browser,
The wrong angle comes from 3rd hat and 4th jewelry

@flowtsohg
Copy link
Owner

flowtsohg commented Sep 30, 2019

Not sure if it's legal to share some of the files in that zip :P

No one really ever tested attachments other than me when implementing them, or the unit test which is very simple, so it's likely it is bugged in some way or another.
I'll set up a scene later and check it out, thanks.

On a side note, I noticed you require fengari. Are you doing with it something related to wc3? :)

@435352980
Copy link
Author

435352980 commented Oct 1, 2019

No, I try to build this project with version4.7.7 but it's seems to missing some dependencies like fengari and child_process. I added them but still not work. So, i change to use version4.7.6.

@flowtsohg
Copy link
Owner

flowtsohg commented Oct 1, 2019

Ah, maybe I added some leftovers by mistake, still not sure how I am going to incorporate that stuff in. I guess it's getting time to allow parts of the library to be optional, but I am not sure how.

That being said, I just checked and didn't see anything I committed by mistake, odd.

flowtsohg added a commit that referenced this issue Oct 3, 2019
- Added also per-instance culling for updates, for instances inside the visible cells. The cost of it is meager next to the savings it gives when viewing maps. That being said, it doesn't support per-instance culling for rendering, need to think more for that.
- MDX billboarded nodes now have the correct orientation, check with #27.
@flowtsohg
Copy link
Owner

For some reason I was thinking this whole time that npm keeps in sync with github. I guess that's not the case, and thus I suppose I kept putting my local experimental stuff in npm by mistake, hence that fengari import.

Either way, this should be fixed now, check it please on your side.

@435352980
Copy link
Author

Yes, build success after 4.8.0.
I found that I had forgotten to provide a list for models, would you like to check it?
Just change the last line code in App.tsx

// change the model name
render(<MdxViewer name="Gilgamesh.mdx" />, document.querySelector('#root'));

On 'Hakuman.mdx' the 18th wing not follow the model, and 'LibGirl.mdx' not show the penultimate seventh wing.
But some models do not show that certain wings are normal, Except for the two I mentioned earlier.
Here is the list.

Hakuman.mdx
Assassin.mdx
Micalela.mdx
Gilgamesh.mdx
sein.mdx
Shinoa.mdx
Berserker.mdx
LibGirl.mdx
CYT-PST
Sione.mdx
DarkMage.mdx
LSWeiss.mdx
Edward.mdx
Ryu.mdx
huashi.mdx
TohsakaRin.mdx
arcaneMage.mdx
Reset_01.mdx
Killua.mdx
Uryu.mdx
Shya.mdx
Sharis.mdx
Chaika.mdx
Mayoi.mdx
Beast_XH.mdx
LS R.max
Desperado_fix7.mdx
Youmu.mdx
Kururu.mdx
Jueviolace.mdx
KagariAtsuko.mdx

@flowtsohg
Copy link
Owner

flowtsohg commented Oct 3, 2019

I meant that the orientation issues with billboarding should be fixed. Did you check them?
I am not quite sure what works and what not, do the models in that big list also have issues?

@435352980
Copy link
Author

Yes, it fix. Orientation now is normal width all of the models that i test.

For wings, only Hakuman.mdx and LibGirl.mdx
has different behavior form games.

@flowtsohg
Copy link
Owner

Hakuman seems to work correctly - when you use the chest attachment, the wings don't move, because the chest attachment never moves.
I tested all of the wings on LibGirl, and didn't notice any problem.

@435352980
Copy link
Author

Ah, maybe I added some leftovers by mistake, still not sure how I am going to incorporate that stuff in. I guess it's getting time to allow parts of the library to be optional, but I am not sure how.

That being said, I just checked and didn't see anything I committed by mistake, odd.

fengari-lua/fengari#156 (comment)

@flowtsohg
Copy link
Owner

flowtsohg commented Oct 11, 2019

Ah you are right, I forgot to commit the webpack config file.

Are the other issues solved though? :P

@435352980
Copy link
Author

Yes, all solved :)
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants