Creating Primaries for .cvh

Discussion area for user-created Allegiance models, textures, voicechats, music, and other ingame content.
Post Reply
Ramaglor
Posts: 687
Joined: Sun Aug 28, 2005 7:00 am
Location: Seattle

Post by Ramaglor »

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]
KGJV
Posts: 1474
Joined: Tue Jul 01, 2003 7:00 am
Location: Transilvania

Post by KGJV »

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.
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" />)

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.
Image
Ramaglor
Posts: 687
Joined: Sun Aug 28, 2005 7:00 am
Location: Seattle

Post by Ramaglor »

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.
Spidey's tactical advice on TS during Tourny game
QUOTE We don't need to save our thingy.[/quote]
mesial
Posts: 3009
Joined: Sun Dec 26, 2004 8:00 am
Location: Florida

Post by mesial »

Ramaglor wrote:QUOTE (Ramaglor @ Sep 15 2007, 07:47 PM) ....haven't tried it in game though.
That might be a whole 'nother story.
Allegiance Terror Alert Level: HIGH
madpeople
Posts: 4787
Joined: Tue Dec 16, 2003 8:00 am
Location: England

Post by madpeople »

i think you can make any shape cvh box you want provided it is convex.
KGJV
Posts: 1474
Joined: Tue Jul 01, 2003 7:00 am
Location: Transilvania

Post by KGJV »

Looking as the code, a CVH file must contain:

Code: Select all

header
N=number of shapes
hull1
...
hullN

frame1
..
frameX
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.
Image
KGJV
Posts: 1474
Joined: Tue Jul 01, 2003 7:00 am
Location: Transilvania

Post by KGJV »

I forgot to add that AMT is considered 'old tool'.

If you want accurate and bug free models you should use the MDL tools set but I agree this is very less handy and user friendly than Milkshape+AMT. /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt="laugh.gif" />
Image
mesial
Posts: 3009
Joined: Sun Dec 26, 2004 8:00 am
Location: Florida

Post by mesial »

Please, please use the MDL tools. /cool.gif" style="vertical-align:middle" emoid=":cool:" border="0" alt="cool.gif" />
Allegiance Terror Alert Level: HIGH
Post Reply