Creating Primaries for .cvh
So why did Orion say that you can't make your own primaries for the .cvh? Because I have been able to export, and then import back into milkshape with no problems, a .cvh made with a single, 23 vertex box....haven't tried it in game though.
Spidey's tactical advice on TS during Tourny game
QUOTE We don't need to save our thingy.[/quote]
QUOTE We don't need to save our thingy.[/quote]
the code requires that each cvh shape must be 'convex'. (standard definition of convex /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />)Ramaglor wrote:QUOTE (Ramaglor @ Sep 16 2007, 01:47 AM) So why did Orion say that you can't make your own primaries for the .cvh? Because I have been able to export, and then import back into milkshape with no problems, a .cvh made with a single, 23 vertex box....haven't tried it in game though.
AMT (the milkshape plugin) doesnt test if shapes are convex or not.
btw CVH = ConVex Hull
Last edited by KGJV on Sun Sep 16, 2007 12:53 am, edited 1 time in total.
QUOTE Only use simple primitive objects for bounding boxes. You may rearrange the vertices to your liking, but remember you cannot make your own primitives.[/quote]
QUOTE In constructive solid geometry, primitives are simple geometric shapes such as a cube, cylinder, sphere, cone, pyramid, torus.[/quote]
I know they have to be convex... I believe what Orion was talking about was using the milkshape commands of "box" "cylinder" and "sphere" (along with editing them of course) are the only way to make .cvh. I did it without using those commands, and it seems fine.
QUOTE In constructive solid geometry, primitives are simple geometric shapes such as a cube, cylinder, sphere, cone, pyramid, torus.[/quote]
I know they have to be convex... I believe what Orion was talking about was using the milkshape commands of "box" "cylinder" and "sphere" (along with editing them of course) are the only way to make .cvh. I did it without using those commands, and it seems fine.
Spidey's tactical advice on TS during Tourny game
QUOTE We don't need to save our thingy.[/quote]
QUOTE We don't need to save our thingy.[/quote]
Looking as the code, a CVH file must contain:
The header is a bounding ellipse equation (5 values)
N is the number of 'hulls' (shapes). It must be at least 1 and at max 126.
A hull is a serie of vertices (x,y,z points) and adjacencies (how vertices are connected). This forms a 3D shape. It must be convex.
a "frame" is named position+orientation pair. So it's simply a name and 2 x,y,z vectors. There is no limit to the number of frames.
AMT was created before Alleg source code was released so by that time I didnt know the header contained an ellipse equation (EE). I assumed it was a bounding box (BB) equation so AMT simply calculates the BB and writes it in the EE position. Fortunatly this is ok, it's just that it's less refined (the BB is viewed as a sphere which is an ellipse).
Also Milkshape can only handle faces defined by triangles (3 connected vertices). CVH faces can be defined from any numbers of connected vertices as long as it's in the same plane.
For instance a box in Milkshape is 8 vertices and 12 triangles. In CVH it can be 8 vertices and 6 'squares faces' only but there is no problem defining it with 12 triangles too. It just add extra datas but this doesnt change the collision detection behavior.
That is what AMT does, it always import/export using triangles because of Milkshape limitation.
I guess we could optimize AMT export to 'merge' coplanar triangles into a single "CVH face" but i'm not sure we will gain much performance.
So back to your question. I really think there is no problem if a hull (= a cvh group in Milkshape) is made by hand not using "primaries" as long as it's convex.
Code: Select all
header
N=number of shapes
hull1
...
hullN
frame1
..
frameXN is the number of 'hulls' (shapes). It must be at least 1 and at max 126.
A hull is a serie of vertices (x,y,z points) and adjacencies (how vertices are connected). This forms a 3D shape. It must be convex.
a "frame" is named position+orientation pair. So it's simply a name and 2 x,y,z vectors. There is no limit to the number of frames.
AMT was created before Alleg source code was released so by that time I didnt know the header contained an ellipse equation (EE). I assumed it was a bounding box (BB) equation so AMT simply calculates the BB and writes it in the EE position. Fortunatly this is ok, it's just that it's less refined (the BB is viewed as a sphere which is an ellipse).
Also Milkshape can only handle faces defined by triangles (3 connected vertices). CVH faces can be defined from any numbers of connected vertices as long as it's in the same plane.
For instance a box in Milkshape is 8 vertices and 12 triangles. In CVH it can be 8 vertices and 6 'squares faces' only but there is no problem defining it with 12 triangles too. It just add extra datas but this doesnt change the collision detection behavior.
That is what AMT does, it always import/export using triangles because of Milkshape limitation.
I guess we could optimize AMT export to 'merge' coplanar triangles into a single "CVH face" but i'm not sure we will gain much performance.
So back to your question. I really think there is no problem if a hull (= a cvh group in Milkshape) is made by hand not using "primaries" as long as it's convex.


