Kollisionsabfrage(aber richtig :-))
Übersicht

haschhaseBetreff: Kollisionsabfrage(aber richtig :-)) |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
also ich will ne kollisionsabfrage schreiben, nur geht es irgendwie nicht so wie ich es mir erwünscht hätte
Code: [AUSKLAPPEN] AppTitle "testlevel by Raphael M."
Graphics3D 1024,768,32,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,10,4,10 EntityType camera,1 light=CreateLight() RotateEntity light,90,0,0 crosshair=LoadImage("gfx/crosshair.png") MaskImage crosshair,255,255,255 terrain=LoadTerrain("mesh/hmap.bmp") TerrainDetail terrain,4000,True ScaleEntity terrain,1,50,1 grass_tex=LoadTexture("mesh/MossyGround.bmp") ScaleTexture grass_tex,50,50 EntityTexture terrain,grass_tex,0,1 Global marine=LoadMesh("mesh/odst.3ds") ScaleEntity marine,0.2,0.2,0.2 EntityType marine,3 Global stadt=LoadMesh("mesh/stadt.3ds") ScaleEntity stadt,0.2,0.2,0.2 EntityType stadt,2 While Not KeyHit(1) mouse# = MouseYSpeed() If KeyDown(203)=1 Then x#=x#-0.4 If KeyDown(205)=1 Then x#=x#+0.4 If KeyDown(208)=1 Then y#=y#-0.4 If KeyDown(200)=1 Then y#=y#+0.4 If KeyDown(44)=1 Then z#=z#-0.4 If KeyDown(30)=1 Then z#=z#+0.4 If KeyDown(205)=1 Then TurnEntity camera,0,-1,0 If KeyDown(203)=1 Then TurnEntity camera,0,1,0 If KeyDown(208)=1 Then MoveEntity camera,0,0,-0.1 If KeyDown(200)=1 Then MoveEntity camera,0,0,0.1 x#=EntityX(camera) y#=EntityY(camera) z#=EntityZ(camera) terra_y#=TerrainY(terrain,x#,y#,z#)+5 PositionEntity camera,x#,terra_y#,z# Collisions 1,2,2,2 Collisions 1,3,3,3 If EntityPitch(camera) - mouse > -89 Then RotateEntity camera, EntityPitch(camera) + mouse, EntityYaw(camera), 0 Else RotateEntity camera, -89, EntityYaw(camera), 0 EndIf If EntityPitch(camera) + mouse < 89 Then RotateEntity camera, EntityPitch(camera) + Mouse, EntityYaw(camera), 0 Else RotateEntity camera, 89, EntityYaw(camera), 0 EndIf RotateEntity camera, EntityPitch(camera), EntityYaw(camera) + MouseXSpeed()*-1, 0 UpdateWorld() RenderWorld() DrawImage crosshair,512,384 Text 3,10,"Texturen geladen..." Text 6,20,"Models geladen..." Text 0,0,EntityPitch(camera) + mouse MoveMouse GraphicsWidth() / 2, GraphicsHeight() / 2 Flip Wend End wie ihr seht, hab ich auf 1. die camera 2.stadt 3.marine aber ich kann trotzdem durch den marine durchlaufen, aber durch die stadt gehts net, da hat die kollisionsabfrage gefunzt und nun mein 2.tes prrob, ich hab ne leichte schräge, so ungefähr 30° ich kann ein stückchen hochlaufen,aber dann gehts net mehr weiter, ka woran das liegt und ein 3. prob ich hab ne map, hab eine einkerbung drin, die camera fleigt einfach drüber, anstatt runter zu gehen ich hoffe einer von euch kann mir helfen danke |
||
nei nei so kann das nicht weitergehen... |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group