closion !?
Blitz3D Forums/Blitz3D Beginners Area/closion !?
| ||
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 |
| ||
Your code is incomplete. And you're trying to set up collisions on three objects that do not exist. |
| ||
why? plz help, send me a cod thats work |
| ||
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 |
| ||
that dident work either :S now im geting scary that i has some wrong im my game |
| ||
The above code works perfectly. In what way is it "not working"? |
| ||
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^^ |
| ||
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. |
| ||
but hay you need to give me a exampel! |
| ||
but i dont need a spherd 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.or i dont has any.. but hay I just bloody did that and you told me it didn't work! you need to give me a exampel! |
| ||
ok thx all |
| ||
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 |
| ||
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. |
| ||
Entities are given an entityraduis by default :o) (i think it's 1) You only really need to give them an entitytype number :o) |
| ||
RossC is correct. |
| ||
exmp EntityRadius cbue1, 1, 1, 1 ? |
| ||
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) |
| ||
hmm, i did work out but now, i can go thrue the terrain :P |
| ||
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? |
| ||
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. |
| ||
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^^ |
| ||
Kul ned en svensk i forumet, vad gör du för typ av spel ? Ps. God Jul :) /Thomas |
| ||
nja jag e ensam på projektet men, aa ett litet arena ww2 spel go jul på dej med ;) |
| ||
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"..... |
| ||
<snip> |
| ||
hehe tackar ;) |
| ||
I'm too lazy to interpret what you're saying. What are you saying?!? |
| ||
This is great - can I play too? |
| ||
I can't speak whatever you're speaking!!! |
| ||
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 |