Using Morph-Shapes done with 3DMeNow

Community Forums/Developer Stations/Using Morph-Shapes done with 3DMeNow

Chi3f Stadi(Posted 2003) [#1]
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


darklordz(Posted 2003) [#2]
I've used 3d me now before and it's great but never in combination with B3D....i'll look into it....


Chi3f Stadi(Posted 2003) [#3]
Thanks for your help !

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


Chi3f Stadi(Posted 2003) [#4]
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 ?


LAB[au](Posted 2003) [#5]
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


Chi3f Stadi(Posted 2003) [#6]
LAB[au]

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

best rgds
Karel


LAB[au](Posted 2003) [#7]
I forgot this!

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


Chi3f Stadi(Posted 2003) [#8]
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