0

Unexpected skin behaviour

Anonymous 10 years ago updated by Fdjjj Duuree 3 years ago 23
This discussion was imported from CodePlex

saphua wrote at 2011-02-24 18:55:

Hello,

Disclaimer: First time user of Helix and complete 3D nubcake.

I am trying to load and display 3d models from a game called League of Legends. The models are stored as .skn files and the materials as .dds files. I found two tools that help me conver these to a .obj and a .jpg file.

After converting I can add them to a Expression Bled project and drop the .obj file in my workspace. I can then alter the create DiffuseMaterial to use a ImageBrush and get this result:

http://stuff.saphua.com/Temp/Helix/blend.jpg

Now I am trying to do the same using Helix using this simple method which loads and parses the .obj file and changes the Diffusematerial to use an ImageBrush with the .jpg file:

        private Model3D LoadFile(string objPath, string jpgPath)
        {
            BitmapImage bmp = new BitmapImage();
            bmp.BeginInit();
            bmp.UriSource = new Uri(jpgPath, UriKind.Relative);
            bmp.EndInit();

            Model3DGroup group = ModelImporter.Load(objPath);
            GeometryModel3D model = group.Children[0] as GeometryModel3D;
            MaterialGroup materialGroup = model.Material as MaterialGroup;
            DiffuseMaterial material = materialGroup.Children[0] as DiffuseMaterial;
            material.Brush = new ImageBrush(bmp);
            return group;
        }

However, this produces this result (face-sword?):

http://stuff.saphua.com/Temp/Helix/helix.jpg

What do I need to do to fix this?

Here are my source files (copyright League of Legends blah blah!)

http://stuff.saphua.com/Temp/Helix/model.jpg
http://stuff.saphua.com/Temp/Helix/model.obj

Thanks!


saphua wrote at 2011-02-25 09:52:

Ok, I am one step further:

Apperantly when I flip the image vertically it works perfectly.

Now I need to figure out how to do this in Helix.

Edit: Applying a ScaleTransform to the Brush doesn't seem to change a thing.

Edit: Oh wait, it does work! Woohoo!


objo wrote at 2011-02-25 11:23:

there might be a bug in the obj importer - not sure if I tested it with texture coordinates - try to change the ObjReader.AddTexCoord method to

        private void AddTexCoord(string values)
        {
            double[] fields = Split(values);
            TexCoords.Add(new Point(fields[0], 1-fields[1]));
        }

let us know if this solves the problem!


saphua wrote at 2011-03-01 12:06:

Yes that fixed it, although I'm not sure if my textures are upside down or if the code was 'upside down'.


objo wrote at 2011-03-02 19:50:

If it was correct in Blend I guess this was wrong in Helix toolkit. I will check with other obj files with texture coordinates.

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

ebet

ทางเข้าเล่นคาสิโนebet

ทางเข้าเล่นคาสิโนออนไลน์ebet

These are great wise words from the voice of experience and talented person like you! Thank your for sharing all of this and more motivating us.

gold diamond gaming

ทางเข้าเล่นคาสิโนgold diamond gaming

ทางเข้าเล่นgdg casino

These are great wise words from the voice of experience and talented person like you! Thank your for sharing all of this and more motivating us.

sexy baccara

เล่นคาสิโนsexy baccaratเว็บไหนดี

เล่นคาสิโนsexy baccaratเว็บไหนดีpantip

These are great wise words from the voice of experience and talented person like you! Thank your for sharing all of this and more motivating us.

ufabet

เว็บพนันufabetเว็บไหนดี

สมัครเว็บพนันufabetเว็บไหนดี

You seemed to have thought of everything in this topic! I will save your site and come back here real soon to read more informative post from you.

กำถั่ว

ทางเข้าเล่นกำถั่ว

ทางเข้าเล่นกำถั่วขั้นต่ำ 2 บาท