Two quick questions...

Blitz3D Forums/Blitz3D Programming/Two quick questions...

roboslug(Posted 2003) [#1]
Not new to programming or 3d programming...but new to Blitz and confused about some blitzisms (maybe DirectX related on question #2).

1.> ExtractAnimSeq only extracts "MD2 style" animation sequence from a animated mesh (as per docs) or ACTUALLY can extract animation sequence from an animated MD2 mesh?

I realize that MD2 is supposed to be used with the MD2 commands, but I was under the potentially false impression that ExtractAnimSequence was one way to get around this. If this is not the case and "MD2 style" means all animation frames in one file...well...the docs should be more clear.

I.E.,

this does not appear to work:

Bandit = LoadMD2( "model\Bandit_031_Fire_Qtip.md2" )
nseq = ExtractAnimSeq(Bandit,1,18)
Print nseq ; output is -1
Animate Bandit,3,0.7,1,2 ; fault
Animate Bandit,3,0.7,nseq,2 ; also fault

But this does (as expected):

Bandit = LoadMD2( "model\Bandit_031_Fire_Qtip.md2" )
AnimateMD2 Bandit,3,0.7,1,18,2

2.> Blitz3d does or does not clip the off camera polygons from a single mesh if any of the polygons of that mesh are visible to the camera? My mesh is also single surface if that matters.

Maybe clip is not the right term here (usually reserved to those polygons hidden behind the visible I think), but it seems that I have an entire world box that is getting sent to the pipeline, even though the box is 1000+ tripolys (well...because I presumed B3D would be able to clip the off camera ones...).

So far it seems this is a big NO, but maybe I am missing something...

Having written my own 3d engine in college, I must admit that I am slightly baffled by this, but then again, that was back when realtime 3d games where flat polygons...shaded if you were good.

I guess what confuses me the most is that the terrain (builtin style),player object,plus some simple world objects,and lots of sprites was faster than the world box,player,10-20 sprites I have now.

Thanks for your help and forgive my basic questions. :-)


Mustang(Posted 2003) [#2]
2. Blitz3D has object-based culling... this is the right way to do things these days as checking every polygon (for culling) is too slow; often it's faster to draw the whole object even if some of it is "behind the camera".

BUT - this means that you have to construct your game world correctly... using one mega-big lump level will be drawn fully every frame, so it's better to chop it to smaller pieces for faster speeds (although increasing object count will slow things down too, so don't chop it to too small pieces!).

I do it so that I have rooms that have been chopped to top, bottom and 2-4 wall sections at least -- this because if you think how and what player sees in FPS game (I'm doing an FPS) is that if you see the ceiling, you don't (at least most often) see the floor, ie these should be separate objects. Same goes for opposite walls etc.


jhocking(Posted 2003) [#3]
A couple things to note about ExtractAnimSeq. One is that you don't use the value returned; animation sequences are automatically numbered from 0 on (with 0 being the full animation of the loaded model before ExtractAnimSeq is used) based on the order the animation sequences are extracted. Thus the first time you use ExtractAnimSeq the extracted sequence is numbered 1.

Second, the normal animation commands (including ExtractAnimSeq) do not work with md2 models. They are only for 3ds, x, and b3d models. MD2 commands (like AnimateMD2) must be used with md2 models. You'll just have to use the correct frames when you call AnimateMD2.


roboslug(Posted 2003) [#4]
Thanks guys, both answers as I suspected. Appreciate the feedback and tips.

My one world box was just a place holder, but I wanted to know how blitz culled before I started working on the world models.

I use the return value of ExtractAnimSeq in a more complicated chunk of code that stores the sequence number in a type for that animation move. I basically have a wrapper function that lets you append anim sequences either from a file or from a frame within that file to handle both "anim styles".

MD2 just tossed the monkey into my works as the artist on the project found that 3DS didn't work for the latest model and resorted to MD2 for 3d Max->character studio->blitz conversion.

Sigh...more silly condition checking code.

Cheers!
Donovan