CreateSphere (100) Max ?

Blitz3D Forums/Blitz3D Beginners Area/CreateSphere (100) Max ?

Prym(Posted 2016) [#1]
Est-il déconseillé
de donner une valeur 100 (maxi) à CreateSphere ?

Je pense qu'avec une valeur élevée ,
les collisions sont mieux détectées .

Dans ce cas ,
Existe-t-il quelque chose (dll , ...)
pour augmenter cette valeur ?

Difficile de trouver un renseignement sur ce détail .
Merci d'avance pour vos précisions .


Prym(Posted 2016) [#2]
Is it safe
Give a value of 100 (max) to CreateSphere?

I think with a high value,
Collisions are best detected.

In that case ,
-Is there something (dll, ...)
To increase this value?

Hard to find any information on this detail.
Thanks in advance for your clarification.


RemiD(Posted 2016) [#3]

I think with a high value,
Collisions are best detected.


It is useless and will slow down the collision detection a lot !

Using Blitz3d collisions system,

For colliders (the shapes which provoke the collision, which turn move), you can only use ellipsoids (entityradius defines the radius of an ellipsoid collider), they have the shape of a sphere but they are not meshes.

For collidables (the shapes which receive a collision, the obstacles, which are static), you want to use low details meshes, and if you want to prevent bugs, you want to use closed welded meshes (Fragmotion can help you to do that)

You can see a simple collision detection and response example here :
http://www.blitzbasic.com/codearcs/codearcs.php?code=3141
as you can see the collidables are low details and there is no problem...


Prym(Posted 2016) [#4]
Thank you RemiD ,
I will study this page in French and calm .
But thank you for your comment :
"It is useless and will slow down the collision detection a lot ! "
I see that collision management resembles that of Tokamak and ,
I suppose , that of other physical engines .
( colliders & collidables )


RemiD(Posted 2016) [#5]
Not sure what is your goal, but if it is simply to oriente a spaceship over a planet, when the spaceship is far from the surface of the planet, instead of using a sphere as the collidable, you could use an ellipsoid (with entityradius())
and when the spaceship is near the surface of the planet, use a ROAM terrain (with createterrain and not too much tris (set with terraindetail()))

in both cases the collisions detection should be faster than using a highly subdivided sphere...


Prym(Posted 2016) [#6]
Hello RemiD,
and thank you for these details.
I am mostly at the first solution .
I will remember to use 'terraindetail ()'.


K(Posted 2017) [#7]
@Prym: En bref, augmenter le niveau de détail redrait la detection des collisions plus precises, mais ne serait pas du tout efficace.

Comme le RemiD a dit, si c pour un cas comme planète + objet en orbite, c mieux utiliser la mèthode...
Collisions TypeA,TypeB,1,Réponse... ça marche bien parce qu'il fait ses detections par distance et ne tien pas compte de structure de l'objet.


RemiD(Posted 2017) [#8]
@K>>except i proposed to use a pickable ellipsoid (using entityradius() and entitypickmode() ) and linepick, not collisions...

Something like :
Global SpaceShip_Root = CreatePivot()
PositionEntity(SpaceShip_Root,0,500.0+10.0,0,True)

Global Planet_Pickable = CreatePivot()
PositionEntity(Planet_Pickable,0,0,0,True)
EntityRadius(Planet_Pickable,500) ;radius of ellipsoid

EntityPickMode(Planet_Pickable,1) ;1 : pickable ellipsoid | 2: pickable mesh
TFormVector(0,-20,0,SpaceShip_Root,0) ;vector from SpaceShip position to 20units below (on the -Y axis)
LinePick(EntityX(SpaceShip_Root,True),EntityY(SpaceShip_Root,True),EntityZ(SpaceShip_Root,True),TFormedX(),TFormedY(),TFormedZ(),0.001)
PEnt% = PickedEntity()
If( PEnt <> 0 )
 Ground_X# = PickedX() : Ground_Y# = PickedY() : Ground_Z# = PickedZ()
 Ground_NX# = PickedNX() : Ground_NY# = PickedNY() : Ground_NZ# = PickedNZ()
EndIf



RemiD(Posted 2017) [#9]
@K>>except i proposed to use a pickable ellipsoid (using entityradius() and entitypickmode() ) and linepick, not collisions...

Something like :
Global SpaceShip_Root = CreatePivot()
PositionEntity(SpaceShip_Root,0,500.0+10.0,0,True)

Global Planet_Pickable = CreatePivot()
PositionEntity(Planet_Pickable,0,0,0,True)
EntityRadius(Planet_Pickable,500) ;radius of ellipsoid

EntityPickMode(Planet_Pickable,1) ;1 : pickable ellipsoid | 2: pickable mesh
TFormVector(0,-20,0,SpaceShip_Root,0) ;vector from the position of the SpaceShip to 20units below it (on the local -Y axis of the SpaceShip)
LinePick(EntityX(SpaceShip_Root,True),EntityY(SpaceShip_Root,True),EntityZ(SpaceShip_Root,True),TFormedX(),TFormedY(),TFormedZ(),0.001) ;throw linepick from the position of SpaceShip with the vector direction, length
PEnt% = PickedEntity()
If( PEnt <> 0 )
 Ground_X# = PickedX() : Ground_Y# = PickedY() : Ground_Z# = PickedZ()
 Ground_NX# = PickedNX() : Ground_NY# = PickedNY() : Ground_NZ# = PickedNZ()
EndIf



K(Posted 2017) [#10]
True dat. They should each work.


Prym(Posted February) [#11]
Salut à tous ,
Je précise que j'ai transformé une sphère
avec "Spherical landscapes" de David Bird (blitzbasic tools) .
Je lui donne le type polygone (2) .
Le joueur est de type ellipsoïde (1) .
Et cela ne marche pas très bien !
La collision ne semble pas être détectée .
A bientôt .

Hi everybody ,
I said that I transformed a sphere
With 'Spherical landscapes' by David Bird (blitzbasic tools).
I give him the type polygon (2).
The player is of the ellipsoid type (1).
And it does not work very well!
The collision does not appear to be detected.
See you soon .