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

Merge.apply creates dark materials, 4.1.1 #624

Closed
flxeken opened this issue Aug 18, 2013 · 2 comments
Closed

Merge.apply creates dark materials, 4.1.1 #624

flxeken opened this issue Aug 18, 2013 · 2 comments
Assignees
Labels

Comments

@flxeken
Copy link

flxeken commented Aug 18, 2013

When I use the merge tool on two meshes with lighted materials on them I end up with one mesh with pitch black material. If I remove the lightpicker from the materials afterwards they have the right color. It seams that something happens with the way they reflect light when they merge.

to reporoduce:

  1. Create two meshes and apply different ColorMaterials to them. Make sure both materials have the same lightpicker.
  2. merge them by creating a new instance of Merge and calling the apply function.

I get similar problems when using Explode on loaded 3D-models, I have not seen this happen before 4.1 update.

@ghost ghost assigned gonchar Dec 26, 2013
@JohnBrookes
Copy link
Member

Its because of this line
https://github.com/away3d/away3d-core-fp11/blob/dev/src/away3d/tools/commands/Merge.as#L274
Its adding position data to the normals.
So
var m:Matrix3D = mesh.sceneTransform.clone();
m.appendTranslation( -mesh.scenePosition.x, -mesh.scenePosition.y, -mesh.scenePosition.z);
m.transformVectors(normals, normals);

said this on skype a few months ago. Forgot :/

gonchar pushed a commit that referenced this issue Jan 6, 2014
@gonchar
Copy link
Member

gonchar commented Jan 6, 2014

thank you for the issue!

@gonchar gonchar closed this as completed Jan 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants