Page 1 of 2

PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 10:34 am
by neodos
Hello,

Before we start let me clear this, this not really custom collision but how to take a cube and stretch it to transform it to a big flat surface, a wall, a giant cube, a giant pillar etc whatever you want whatever you can do stretching a cube :p

Yes this is boring to do the first time, once you get how it works it's fine, but i hope someone will make an app =D
Please just try once you'll see it's not as complicated as the tut is long...

What we need:
-Entity
-Coll and my PHMO plugins that you can get at the bottom of the thread
-Preferable: basics and understanding of 3D modeling
-Headlong.map

Allright, as always i'll first explain what we are going to do and why.
I am going to take the object called "objects\gear\human\industrial\crate_multi\crate_multi"
Transform it, stecthing it, why do it take this one? it's simple, this object is a cube, the most basic from that can exist in this physics engine.

Second, what's the difference between coll and phmo?

Coll: collision detection model for projectiles but also weapons when dropped on the ground.

Phmo: physics model, for physics reactions, physics interactions between objects such as, mach, bloc,bipd,vehi.

As i said this is a basic model, the most complex task in the example will be Coll, first we need to understand it, to visualize it, phmo is not as complex as coll in this example because it's not using a model:

Phmo has one reflexive for parallelepipedals models(cubic forms) that you can resize with 3 values, xyz,instead of having a model formed by vertex,planes etc.
I am not saying phmo does never use a model, just in this example it doesn't, complex phmo use models but i didn't tried to modify these yet and those are much more complex than coll.


Resizing Coll

Open Entity
Select the tag: coll - "objects\gear\human\industrial\crate_multi\crate_multi"
Open Meta Editor

Wh4t r t3h r3fl3hx1v3hs?

Ok, here is a little explanation of some of the reflexives we need to understand to modify the coll, those that i won't explain are just used for breakable surfaces or count the number of planes and vertex...

Go at the bottom and find "vertrices" reflexive.
This coll model has 8 vertex which form a cube, one vertex is placed in space with the coords XYZ.

Above, Edge buffer, an edge is formed by 2 linkex vertex.
The Edge buffer defines how the vertex are linked and their order forward and reverse edge and the planes(surfaces) that the edge is part of (Left right surfaces).

Planes reflexives:
4 vertex form a plane, which needs to have a facing direction define by the axis ijk and d defines the distance from the intersection of the XYZ axis, coord 0, where the plane 0 is located(so d is the center of the plane (intersection of diagonals) and ijk is its facing direction).


Here is a 3D representation of the coll model:

Image

For those that already did some 3D modeling i guess you don't need to look at this image 8-)

Allright now the problem is, yeah fine it's a cube for sure, but how do i know what i am gonna mooove?
There is the problem, but what i explained above give you the solution.

We have our 8 verte, which are 8 chunks, in the order 0 1 2 3 4 5 6 7,
Simple as this, draw you a cube in a papier, place each vertex as the chunks 0 1 2 3 4 5 6 7 give you the coords for x y z and label each vertex on your cube.

You should get this:

Image

Let's say that you want to stretch your cube now, no wait, you'll need to change the planes information too *sadface*

Image
Planes reflexives:
4 vertex form a plane, which needs to have a facing direction define by the axis ilk and d defines the distance from the intersection of the XYZ axis, coord 0, where the plane 0 is located.

Allright, let's say that we want to enlarge our cube to make a pillar, because PHMO is resized symetricaly using coord 0 as symetrical axis.

Actually the Y size of our cube is of 0.9 units, let's say that i want to make my parallelepipedal of Y= 2

So we will have to move vertex 0 3 4 5 + plane 2 setting Y=1 and vertex 1 2 6 7 and plane 4 setting Y=1

Which should look like this now:

Image


So first we can editing the Vertex reflexive's chunks.

Vertex Chunk 0:

-0.45 x
1 y
0 z
3 First edge

clic save

Vertex Chunk 3:

0.45 x
-1 y
0 z
1 First edge

clic save


Vertex Chunk 4:

-0.45 x
-1 y
0.9 z
4 First edge

clic save


Vertex Chunk 5:

0.45 x
-1 y
0.9 z
5 First edge

clic save


Now do the same for vertex 1 2 6 7, change Y to 1, but keep the value to negative if it is.

Once you have done this go to planes reflexives, we need to update this too to define the distance d of the plane from coord 0(which is the center of the plane 0 btw)

Allright, vertex 0 3 4 5 is plane 2 setting and vertex 1 2 6 7 is plane 4

So go to planes reflexive on the chunk 2 we only need to change d vakue which is 0.45 to 1 and Save
Same thing for plane 4 change d 0.45 to 1 and Save


We are done with coll.

Now phmo, this is much more simple ^_^

Go to the tag
phmo - "objects\gear\human\industrial\crate_multi\crate_multi"
Open Meta Editor

Find the reflexive "Parallelepipedal Physic Model"

Change Y Size to 2 Save.

Note that you can also change the location of the phmo because sometimes you'll need to so the phmo and coll are perfectly place one over the other, to do this you have at the bottom of this reflexive the values X Y Z position.

Now you just need to stretch your MODE so it has the same size as phmo and coll.

Spawn this as a mach, take a mach spawn it's hlmt to the crate multi hlmt.

When you spawn this as a bloc it works but the physics are not fine as we resized it it needs tweaking for the phmo and there are still a lot of unknown values, i'd suggest to multiply the "Moment of inertia" axis you sterched by the factor you resize you phmo and coll on the Phmo Parts reflexive, but it's not enough to get realistic physics for the resized phmo just a little tweak.

so this should be pretty much used for static phmo, unmovable surfaces as mach etc.


Resize model

Go to your mode tag
Open meta editor

Search "Bouding Box" reflexive, resize XX, YY,ZZ coords are needeed
Note that as you resize the box you may want to resize the uv too (UU VV)

That's all, and post your new objects tags!!!

-neodos

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 2:39 pm
by DoorM4n
Your amazing... :D

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 6:04 pm
by Supermodder911
Good job.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 6:18 pm
by OwnZ joO
Wait so you know how to stretch phmo and coll? This could be used to fake custom collision, which who cares if it's proper as long as it works in my opinion.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 6:25 pm
by neodos
You can use this to create giant flat surfaces, wall, boxes etc etc so much, anyway to make complex coll it's possible is an app is made to inject, now i figured out how coll is calculated, this could have been done a while ago though.

Phmo can be much more complex when it has planes, vertex but i didn't made test with it, yet.

Note that you can add chunks on the phmo reflexive for "parallelepipedal model" so you can combine a lot of parallelepipedal to make multiple box forms only 1 tag.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 7:09 pm
by Ogrish
This is what ive been working on, Now i have a better understanding of it thanx.
dont the edge buffers have to be changed as well, or is this done automaticly.

Edit. Ive been using objects\multi\invisable_box\invisable_box phomo, then making my own coll. But my coll hasnt worked maybe now i can fix it. Also i did all this work in a modling app, so the phomo dosnt quite match the visual model.

Thanx again, maybe now i can get it right.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 7:39 pm
by neodos
WoW >_>

I forgot to post the plugins... it's attached to the first post now ^^

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 7:58 pm
by Ogrish
Good plugin this make resizing phomo really easy.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 8:38 pm
by OwnZ joO
I think we need to make an app for this, but we need to plan it before starting it and have a couple people work on it at the same time(each person with a specified responsibility, not just "working"). I think we could make something pretty cool if we did it like that. Anybody interested?

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 8:51 pm
by NotZachary82
amazing! :D

i can do so many things with this! thx neodos! :mrgreen:

Edit: the "objects\gear\human\industrial\crate_multi\crate_multi" tag doesn't have a "Planes" reflexive ... :?

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 9:06 pm
by Dragonfire
I could see the Honda Element now being used in Halo 2 :XD:

Ok, i can see some awesome potential for this, now u mentioned u used a simple box to do this, correct? Now that i think of it, couldnt the warthog coll be resized/streched to almost be that of an atv model? :hmm:

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat Apr 12, 2008 9:14 pm
by Ogrish
To bad we cant edit the sbsp like this, and no we cant, i just tried some simple edits. Same old problems.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sun Apr 13, 2008 12:36 am
by neodos
NotZachary82 wrote:amazing! :D

i can do so many things with this! thx neodos! :mrgreen:

Edit: the "objects\gear\human\industrial\crate_multi\crate_multi" tag doesn't have a "Planes" reflexive ... :?
Yes it does, for the coll tag, for phmo no it doesn't you need to re-read the tut for phmo it's another reflexive.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sun Apr 13, 2008 1:08 am
by NotZachary82
neodos wrote:Yes it does, for the coll tag, for phmo no it doesn't you need to re-read the tut for phmo it's another reflexive.
ya, i noticed that there are 2 reflexives labeled "Planes". :p the one i was looking at was grayed out.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sun Apr 13, 2008 8:18 am
by neodos
Yes for phmo it's grayed out on thi tag because it's not using a model, it's using a reflexive that i labeled as "parallelepipedal models" because it's generates a cubic phmo that you can setup, it's size and placement.

Mhh, anyway i think i am gonna post some new mach tags, so people use this.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sun Apr 13, 2008 9:32 am
by Dragonfire
So r u saying that PHMO and COLL "editing" r kinda the same, just PHMo is linked differently and has 2 planes instead of 1? :?

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sun Apr 13, 2008 1:23 pm
by neodos
No, in this example coll uses indded a model, but phmo doesn't use a model, there is models for phmo but not in this example, in this example i show a reflexive on phmo that is a cube form that you can change it's size.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sun Apr 13, 2008 2:37 pm
by NotZachary82
there is some confusion: i was talking about the [coll] tag having 2 "Planes" reflexives, in which one is grayed out. :?

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sun Apr 13, 2008 2:49 pm
by neodos
Oh yes, sometime sit's grayed outn for this example it's grayed out and it's better like this it's less complex you don't need that reflexive to do this though.

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat May 03, 2008 3:07 am
by NotZachary82
quick question/bump:

ok, so, you say that you're going to
neodos wrote:make my parallelepipedal of Y= 2
but you change the Y in the collision tag to 1.

i'm confused. are [phmo] values 2 times [coll] values? as in C x 2 = P

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat May 03, 2008 3:42 am
by Dragonfire
No, i think what thats means is he is doing a mirror extrusion of it, meanng that its symetrical so 2 would 1, in that case 1 to the west and 1 to the east from the axis, make sense now?

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat May 03, 2008 4:06 am
by NotZachary82
ya, i get it. :)

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Sat May 03, 2008 6:02 am
by Dragonfire
Wait, OMG this makes perfect sense to me, this is the exact way i made my levels in 3ds max, i just elevated the vertices :shock:

EDIT: Ok, lemme try something of thought here, by the looks here, it seems COLL relies on planes/surfacesvertices to "make itself", correct, or is that PHMo, or an i even close? :?

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Thu May 08, 2008 8:41 pm
by Eaton
Will you able to see the the object in the BSP Viewer? I did this tutorial, but I noticed no change in size of the object. :?

Re: PHMO and COLL: Stretching/Resizing parallelepipedals

Posted: Thu May 08, 2008 8:52 pm
by neodos
The physics and coll changes, you have to resize the model, you can resize the visual model on the mode tag, on the "bouding boxes" at the top of the mode tag meta editor.