closion !?

Blitz3D Forums/Blitz3D Beginners Area/closion !?

MR:Satanist(Posted 2004) [#1]
hi! need som help
the camera dont colision whit the cube ?

cube=CreateCube()
camera=CreateCamera()
PositionEntity camera ,10,2.5,10
PositionEntity cube1,1,5,20
PositionEntity cube2,20,5,1
PositionEntity cube3,40,5,20
EntityType cube1, 2
EntityType cube2, 2
EntityType cube3, 2
EntityType camera, 1
Collisions 1, 2, 1,2


or if it is this cod thats is wrong..
plz help me


GfK(Posted 2004) [#2]
Your code is incomplete. And you're trying to set up collisions on three objects that do not exist.


MR:Satanist(Posted 2004) [#3]
why?
plz help, send me a cod thats work


GfK(Posted 2004) [#4]
Graphics3D 800,600
cube=CreateCube()
sphere = CreateSphere()
camera=CreateCamera()
light = CreateLight()
PositionEntity camera,0,2,-10
PositionEntity sphere,0,6,0
EntityType cube,1
EntityType sphere,2
Collisions 2,1,2,1

gravity# = -0.01
vspeed# = 0

While Not KeyDown(1)
	vspeed = vspeed + gravity
	TranslateEntity sphere,0,vspeed,0
	UpdateWorld()
	If CountCollisions(sphere)
		vspeed = Abs(vspeed)
	EndIf
	RenderWorld()
	Flip
Wend



MR:Satanist(Posted 2004) [#5]
that dident work either :S
now im geting scary that i has some wrong im my game


GfK(Posted 2004) [#6]
The above code works perfectly. In what way is it "not working"?


MR:Satanist(Posted 2004) [#7]
kind a wierd,
but i think it me that have made it wrong
but i dont need a spherd
or i dont has any..
but is you got msn i can send you som shit of my ^^game^^


Ross C(Posted 2004) [#8]
Main things you need

Your camera needs an entity type number
Your Terrain needs an entity type number
You need to have the collision command in there
You need to make sure the camera doesn't start halfway through a mesh. Kind like Gfk's code there.


MR:Satanist(Posted 2004) [#9]
but hay
you need to give me a exampel!


GfK(Posted 2004) [#10]
but i dont need a spherd
or i dont has any..
I'm merely explaining the concept of collisions to you. You will need to read up on the collision commands and decide how best to implement it into your own code.
but hay
you need to give me a exampel!
I just bloody did that and you told me it didn't work!


MR:Satanist(Posted 2004) [#11]
ok thx all


Ross C(Posted 2004) [#12]

Graphics3d 800,600
setbuffer backbuffer()

light = createlight()

cube=CreateCube() 
camera=CreateCamera()
camerarange camera,0.1,1000
positionentity camera,0,0,-10

PositionEntity cube,3,0,5

EntityType cube, 2
 
EntityType camera, 1 

Collisions 1, 2, 1,2


while not keyhit(1)

    if keydown(203) then turnentity camera,0,1,0
    if keydown(205) then turnentity camera,0,-1,0
    if keydown(200) then moveentity camera,0,0,0.1
    if keydown(208) then moveentity camera,0,0,-0.1

    updateworld
    renderworld
    flip
wend



Jellon(Posted 2004) [#13]
Maybe I'm just being stupid, but don't you need to give a radius or box to at least one of the two? Here is a quote from the collisions documentation:
"Blitz has many ways of checking for collisions, as denoted by the method parameter. However, collision checking is always ellipsoid to something. In order for Blitz to know what size a source entity is, you must first assign an entity radius to all source entities using EntityRadius."
That is probably what is lacking.


Ross C(Posted 2004) [#14]
Entities are given an entityraduis by default :o) (i think it's 1) You only really need to give them an entitytype number :o)


GfK(Posted 2004) [#15]
RossC is correct.


MR:Satanist(Posted 2004) [#16]
exmp


EntityRadius cbue1, 1, 1, 1

?


Ross C(Posted 2004) [#17]
If you spelled cube correctly, that's right, but blitz gives raduis's automatically. Me and Gfk have given you working code examples. If you need more help, please explain what you talking about instead of a couple of mis-spelt words and a question mark :o)


MR:Satanist(Posted 2004) [#18]
hmm, i did work out but now, i can go thrue the terrain
:P


MR:Satanist(Posted 2004) [#19]
cool fixed it out to, but i want the cube biger inte radius
it aint going biget
i has a map

+----------+
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+----------+


the sides are the cube and i want a colision intes only in the midel of the wall

why?


Ross C(Posted 2004) [#20]
I don't quite understand what your saying up there. I cna't make out some of the words, like "cube biger inte radius". But remember the moving object, can only use the entityraduis when colliding. It can't use box or polygon.


MR:Satanist(Posted 2004) [#21]
ok... hehe i meant
^^the side of the map is 4 cubes i can go thrue the wall but not in the middel of the wall i want my colison
biger if o do that its only geting a biger box and lesser space to move on^^


Alienforce(Posted 2004) [#22]
Kul ned en svensk i forumet, vad gör du för typ av spel ?
Ps. God Jul :)

/Thomas


MR:Satanist(Posted 2004) [#23]
nja jag e ensam på projektet men, aa ett litet arena ww2 spel


go jul på dej med ;)


wedoe(Posted 2004) [#24]
Dette er en kjempefin web-side hvis man lurer på hva svenske ord heter på engelsk:
http://www-lexikon.nada.kth.se/skolverket/sve-eng.shtml

Prøv t.ex. ordene "kollision", "genom" og "sfär".....


GfK(Posted 2004) [#25]
<snip>


MR:Satanist(Posted 2004) [#26]
hehe tackar ;)


wizzlefish(Posted 2004) [#27]
I'm too lazy to interpret what you're saying. What are you saying?!?


puki(Posted 2004) [#28]
This is great - can I play too?


wizzlefish(Posted 2005) [#29]
I can't speak whatever you're speaking!!!


wedoe(Posted 2005) [#30]
It's Swedish and Norwegian, (close related languages) we understand eachother pretty well :)
BTW: Danish is pretty similar too in it's written form, but the pronounciation sounds awful ;P