ScaleEntity Command

Blitz3D Forums/Blitz3D Programming/ScaleEntity Command

Ash_UK(Posted 2003) [#1]
Hi guys, i'm having a problem with the scaleentity command. For some odd reason i just can't get the collision radius to work right. For example, if i give him a radius of 23 say, he would fall through the floor, but if i gave him a 200 radius, he fits on the floor but the collison is too big (Its like theres a big barrier around him).I really need to find out how to get the radius just right so that he fits on the floor and can walk around properly.
Here's my piece of code that's causing the problem:


;-----------------
;Initialise player
;-----------------
player_texture=LoadTexture("gfx/textures/blue_tex.bmp")
lightmap=LoadTexture("gfx/textures/lightmap.bmp",64)
Global player=LoadAnimMesh("gfx/models/blue.3ds")
Global player_cell=LoadAnimMesh("gfx/models/blue.3ds",player)
head=FindChild(player,"head")
EntityTexture head,player_texture
body=FindChild(player,"body")
EntityTexture body,player_texture
left_arm=FindChild(player,"larm")
EntityTexture left_arm,player_texture
right_arm=FindChild(player,"rarm")
EntityTexture right_arm,player_texture
left_foot=FindChild(player,"lfoot")
EntityTexture left_foot,player_texture
right_foot=FindChild(player,"rfoot")
EntityTexture right_foot,player_texture
cellshade(player_cell)
EntityTexture player,lightmap
EntityType player,player_col
EntityRadius player,23



Just so as to give you an idea of how my model is set out, here is a pic:






Please, please..If anyone can help me with this frustrating problem it would really make my day, i'd really appriciate some guidance here.

Thanks for any help


WolRon(Posted 2003) [#2]
I don't really understand your question but from the way it sounds, can't you use more than 1 sphere to represent your model?

Something like:
+ = sphere
M = model

    ++ 
   ++++
  ++MM++
 +++MM+++
 ++MMMM++
  M+MM+M
 M +MM+ M
 M  MM  M
 M  MM  M
   +MM+
  +M++M+
 ++M++M++
 ++M++M++
  +M++M+
   M++M
  MM++MM
 



Ash_UK(Posted 2003) [#3]
I really don't know how to set this and get it working, does anyone know how sort problem out?

Thanks


-=Darkheart=-(Posted 2003) [#4]
The problem you are having is that your model is not really very spherical so when you use the sphere you are ending up with the radius being too wide.

Try this:

Divide your model into multple collision points and use a centralised pivot (parent the ellipsoids to it) to keep them altogether. I would suggest trying 5 ellipsoides, use the bottom 2 only for ground collisions.

Darkheart


GfK(Posted 2003) [#5]
First off, if you put the texture into the same folder as the model, you can get rid of all that FindChild/EntityTexture lark, because the texture will be automatically loaded with the model.

Second, it sounds like the handle/axis of your model is badly placed - probably positioned too high. You don't have much control over this when exporting from 3DS Max tho (which you appear to be using). What I do, is create a cube where I want the handle of the object to be, find the cube in blitz, create a pivot and position it at the cube's position. Then free the cube and parent the entire model to the pivot.

Last, EntityRadius has three parameters now so that you can use ellipsoid collisions by specifying a different sphere width/height. Check the online docs for more info.

PS: What's ScaleEntity got to do with it?!


Ash_UK(Posted 2003) [#6]
Thanks ever so much all your kind help, i'll put it to the test and let you know how i get on. :-)

Thanks again


Ash_UK(Posted 2003) [#7]
Hmmm, I tries attatching my model to a pivot but even that doesn't work. Is there any other way at all?