New Question:
I figured out how to do this with spheres in this example:
AutoCam Off
Phy Start
Sync On : Sync Rate 60
Make Object Sphere 1, 10
Hide Object 1
Move Camera -100
Lock VertexData For Limb 1, 0
Repeat
VertexIndex = Get IndexData(Index) : Inc Index
X1# = X2#
Y1# = Y2#
Z1# = Z2#
X2# = X3#
Y2# = Y3#
Z2# = Z3#
X3# = Get VertexData Position X(VertexIndex) + Object Position X(1)
Y3# = Get VertexData Position Y(VertexIndex) + Object Position Y(1)
Z3# = Get VertexData Position Z(VertexIndex) + Object Position Z(1)
ObjectIndex = Object Count() + 1
if VertexIndex > 2
Make Object Triangle ObjectIndex, X1#, Y1#, Z1#, X2#, Y2#, Z2#, X3#, Y3#, Z3#
Phy Make Rigid Body Dynamic Box ObjectIndex
`Texture Object ObjectIndex, 1
endif
Until Index >= Get VertexData Index Count() - 1
Unlock VertexData
Delete Object 1
Make Object Plain 1, 1000, 1000
XRotate Object 1, 90
Position Object 1, 0, - 20, 0
Phy Make Rigid Body Static Box 1
Do
Control Camera Using Arrowkeys 0,1,1
If ReturnKey() = 1 Then Phy Update
Sync
Loop
This doesn't work for plain objects.
Replace:
with:
Make Object Plain 1, 10, 10
The object wasn't constructed successfully. Try using a box instead of a plain and you end up with something close but not quite what I am trying to do.
I have tried using Lock VertexData For Mesh and it doesn't seem to work.
Another idea is to use memblocks, but idk if it will work with plains.
Old:
What I am trying to do is to take a high poly model and break it up into separate triangle objects.
This isn't easy as it sounds. I have tried about 5-6 times and wasn't able to get it.
Basically what needs to be done is:
- Use vertex data to get vertex positions
- Convert them into world positions by adding the objects position to the vertexes position
The part I can't figure out is figuring what vertexes will form the triangle.
It has to do with Index data, but I haven't really figured out how it works quite yet.
I will post my attempts here soon.
- How to make the triangles (X,Y) into Pyramids (X,Y,Z).
- How to fill these pyramids in the sphere to make the object full with pyramids.
Dark Fire
My future self met up with one day to teach me what I know today.