Using Morph-Shapes done with 3DMeNow

Miscellaneous Forums/Content Creation Tools/Using Morph-Shapes done with 3DMeNow

Hi,

i'm pretty new to the Blitz3D stuff and need some help. If i'm exporting an Animation from 3DMeNow (hope you know it) let's say in .3ds or .x format, i can't animate it in Blitz3D. Tried a lot of things.

I've imported it to MilkShape exported as .x and so on ...
did not work.

Does anybody uses 3DMeNow as well with Blitz3D ?
Is there a workaround.

best rgds
Karel

I've used 3d me now before and it's great but never in combination with B3D....i'll look into it....

Thanks for your help !

Hope you figure out how to use ... :-)

I got 1 step further. I can access the morph-shapes using the GetChild(3dmenow_mesh,index) function.

But how do i used that in the game so i looks like a smooth animation ?

any ideas ?

For vertex animation, I do like this. Export 2 separate meshes from your modeling package. The 2 meshes are the starting and ending states, thus they have the same number of vertices, same positionning also,...

Then each loop I move a little bit the vertices of the "start mesh" to the position they have in the "end mesh"

here is a function I am using, I didn't took the time to clean the code and to comment it, hopes this helps...

For a.MorphGeometry=Each MorphGeometry
For k=1 To CountSurfaces(a\entityorigin)
surforigin=GetSurface(a\entityorigin,k)
surftarget=GetSurface(a\entitytarget,k)
surfapply=GetSurface(a\entity,k)

For index=0 To (CountVertices(surforigin)-1)
If a\stepcounter <= a\framenumber
newx#=VertexX(surfapply,index)+((VertexX(surftarget,index)-VertexX(surforigin,index))/a\framenumber)
newy#=VertexY(surfapply,index)+((VertexY(surftarget,index)-VertexY(surforigin,index))/a\framenumber)
newz#=VertexZ(surfapply,index)+((VertexZ(surftarget,index)-VertexZ(surforigin,index))/a\framenumber)
VertexCoords surfapply,index,newx#,newy#,newz#
Else If a\stepcounter > a\framenumber And a\stepcounter <= (a\framenumber*2)
newx#=VertexX(surfapply,index)-((VertexX(surftarget,index)-VertexX(surforigin,index))/a\framenumber)
newy#=VertexY(surfapply,index)-((VertexY(surftarget,index)-VertexY(surforigin,index))/a\framenumber)
newz#=VertexZ(surfapply,index)-((VertexZ(surftarget,index)-VertexZ(surforigin,index))/a\framenumber)
VertexCoords surfapply,index,newx#,newy#,newz#
EndIf

Next
Next

If a\stepcounter < (a\framenumber*2)
a\stepcounter=a\stepcounter+1
Else
a\stepcounter=1
EndIf
Next

LAB[au]

Thanks for your help. I guess i have to do it that way. I'll try that out asap.

best rgds
Karel

I forgot this!

Type MorphGeometry
Field entity
Field entityorigin
Field entitytarget
Field framenumber
Field stepcounter
End Type

Hello LAB[au], one question:

What do i assign to "a\entity" ?

I think the others are clear

a\entityorigin=LoadMesh("StartMesh")
a\entitytarget=LoadMesh("EndMesh")

best rgds
Karel