creating a proper 3d player

Blitz3D Forums/Blitz3D Beginners Area/creating a proper 3d player

9310(Posted 2016) [#1]
I came straight from c++ without knowledge of how 3d games.
here's the junk i made https://www.youtube.com/watch?v=Gcy7A534C7g

My 3d player is currently a sphere with alpha=0, scaleentity
I then utilized the parent feature with create camera to attach to the sphere
to get the realistic camera level that isn't where your dirty old toes should be, i used position entity to correct it

this creates a gap between the players sphere which is the real collision here, so my players camera likes to escape the ceiling.

rescaling the sphere to compensate for the collision size will also scale the camera.


and ground detection, i figured i could do EntityCollided to check if my player is touching the map(.b3d model). I can run on walls tho.


whats the alternatives to ground detection besides creating a model for the flooring and the model for the walls and ceiling. will linepick be a suitable substitution, if so how does one even use it.



and ik in the video the math for reloading is incorrect


RemiD(Posted 2016) [#2]
If your character has a humanoid shape, you will find that using only one ellipsoid (sphere) is not ideal. Because if you increase its xyzscale it will be tall enough but too wide and too deep.

An alternative is to use one pivot as the root, and several small ellipsoids set as childs of the root pivot to create a hull. (i use 6 ellipsoids radius 0.25 to have a hull of 0.5,1.75,0.5)
Then you can turn move the root pivot and the ellipsoids will turn move with it and help you to detect collisions. However with this approach you have to reposition the root and the ellipsoids after a collision (no automatic "response")

Another alternative is to use one pivot as the root, and throw several linepicks with their start points depending on the root pivot position and with their directions depending on the root pivot orientation and their lengths depending on the root pivot movement (speed)...
Same as before, you have to reposition the root and the ellipsoids after a collision (no automatic "response")

Another alternative is to use the character capsule collider in the Bullet physics engine...

To detect collision with the ground you can use one linepick with the start point at the middle of your character and the direction to down and the length to at least characterheight/2+1.0, or use an ellipsoid and separate the grounds and the walls and calculate the collision with the grounds or with the walls in different steps (not at the same time).


9310(Posted 2016) [#3]
oh that's genius, i like the sound of the linepicks in multiple directions.
Thanks for the help!!!


edit: works like a charm!i only had to correct the vertical detection to set y velocity to zero and for onground bool i did negative y linepick


RemiD(Posted 2016) [#4]
Good ! :)

To have linepick take less time to calculate, make sure to use low tris pickable meshes.