Modcraft - The community dedicated to quality WoW modding!

Content creation => Modelling and Animation => Topic started by: Garthog on July 04, 2011, 04:27:38 am

Title: [QUESTION] Why does my m2 disappear ?
Post by: Garthog on July 04, 2011, 04:27:38 am
Hi everyone, i'm new to this community ( Sorry, I feel a little rude because I didn't introduce myself :o )
I have a little problem. I took a box model, and i started to edit it.
When I make it longer, it disappears, depending on the angle of the camera. I guess it's because it's bigger than the original M2, and WoW executable "thinks" we don't see it, so, it doesn't render it.

How can I fix this model, so it will render it properly, when we can see it ?
(Also, does someone know another link to a WoW Dev wiki ? )

Thanks !
Title: Re: [QUESTION] Why does my m2 disappear ?
Post by: Garthog on July 06, 2011, 10:12:36 pm
I guess I have a part of the answer.
Maybe the bounding volume isn't updated in the .M2 file, so it takes the old model's bounding volume, and when the bounding volume isn't in the screen, it doesn't render the object.
Do someone know how to change the bounding volume ?

Quote
Retrieved from : http://www.pxr.dk/wowdev/wiki/index.php?title=M-M2 (http://www.pxr.dk/wowdev/wiki/index.php?title=M-M2" onclick="window.open(this.href);return false;)

Render X,Y & Z

Render X, Y and Z defines the render position of the object. Normally if you just move the object and the camera leaves the original object position the object stops rendering. Moving Render X,Y and Z along with the object allows you to to extend the render eara to the intire ADT plane.

How is defined Render X, Y and Z in the client ?
Title: Re: [QUESTION] Why does my m2 disappear ?
Post by: schlumpf on July 06, 2011, 11:18:31 pm
http://www.pxr.dk/wowdev/wiki/index.php ... tLK#Header (http://www.pxr.dk/wowdev/wiki/index.php?title=M2/WotLK#Header" onclick="window.open(this.href);return false;)
Title: Re: [QUESTION] Why does my m2 disappear ?
Post by: Garthog on July 07, 2011, 12:53:46 am
Hm, i looked at this, and I tried 3 different modification on my file ( none of them have worked ) :

0x0B8   float   VertexRadius
0x0D4   float   BoundingRadius

I read your guide on how to hex edit and then I tried some value like : 0x42c80000, or 0x00000000 , but, nothing changed in game. It always disappear.
Then, I tried to change de .skin file, and I changed this :

0x2C    float   Radius         Distance of the vertex farthest from CenterBoundingBox.

To different values. I saw that the value of Radius was quite equal to BoundRadius, but, it didn't changed anything :/.

I guess I'm not looking at the right thing :/. Maybe it's in the Vec3F but i don't really know how to modify them. Is a Vec3F something like 3 float X, Y and Z ?
And is the BoundingRadius related to my issue ?
Title: Re: [QUESTION] Why does my m2 disappear ?
Post by: schlumpf on July 07, 2011, 12:43:50 pm
Yes, a vector of three floats is just three floats.
The two vectors define a box. The radius is additional and the radius of a minimum sphere around the box.
Title: Re: [QUESTION] Why does my m2 disappear ?
Post by: Garthog on July 07, 2011, 02:04:42 pm
So I guess, if I make the box bigger, the M2 won't disappear anymore ? ( it's a gameobject M2 )
Title: Re: [QUESTION] Why does my m2 disappear ?
Post by: schlumpf on July 07, 2011, 02:21:34 pm
Yep. Get the maximum and minimum coordinates in all directions, build two vectors of them, edit these, calculate the radius, done.
Title: Re: [QUESTION] Why does my m2 disappear ?
Post by: Garthog on July 07, 2011, 07:44:10 pm
That's strange. I looked at these values, and I have two point :

Vec3F[1] (-1.019845; -4.450305; 0.012929)
Vec3F[2] (0.941505; 4.595078; 0.441508)

When I try to see what the bounding box looks like, to see if it fit the model, here is what I have :

[attachment=1:nui52icm]Sans titre.png[/attachment:nui52icm]

Are the Vec3F in the good order : X, Y, Z ?

Here is my M2 file. I guess I'm doing something wrong : [attachment=0:nui52icm]modif.M2[/attachment:nui52icm]

Thanks for your reply schlumpf.
Title: Re: [QUESTION] Why does my m2 disappear ?
Post by: schlumpf on July 07, 2011, 09:57:43 pm
The vector is in x, y, z. I don't know what your editors format is though. Every vector for itself is (v1, v2, v3, ..., vn) and in 3D most of the time (x,y,z). This says nothing about the coordinate system used.

I always got the values from just getting minimum and maximum values of all dimensions of all vertices in the model. That always works. And is the way to go actually.