Kollisionen mit der Kamera
Übersicht

EkritsBetreff: Kollisionen mit der Kamera |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Hiu, ich hab probleme mit der Kollision von Kamera Tarrain/Objekt. Pls Help
Code: [AUSKLAPPEN] ; TERRAIN.BB groesse = 2048 Graphics3D 640,460 SetBuffer BackBuffer() cam = CreateCamera() PositionEntity cam, 20,45,20 font = LoadFont("Aria", 35,1,1,1) SetFont font EntityType cam, 1 Text 260,200,"Loading ..." AmbientLight 45,219,249 CameraClsColor cam,45,219,249 CameraFogColor cam,13,13,13 CameraFogRange cam,1,1 cube=CreateCube () cube_text=LoadTexture ("C:\Daten\Diverses\Downloads\text3.bmp") EntityTexture cube,cube_text PositionEntity cube, 1000,45,1000 ScaleEntity cube, 200,100,400 EntityType cube,1 EntityRadius cube,1 cube1=CreateCube () cube_text=LoadTexture ("C:\Daten\Diverses\Downloads\text3.bmp") EntityTexture cube1,cube_text PositionEntity cube1, 200,100,1120 ScaleEntity cube1, 120,100,400 EntityType cube1,1 EntityRadius cube1,1 terrain = CreateTerrain(groesse) textur = LoadTexture("C:\Daten\bilder\gras.bmp") EntityTexture terrain, textur For i=1 To groesse * groesse / 2 ModifyTerrain terrain, Rand(groesse), Rand(groesse), Rnd(-1,+1) Next EntityType terrain, 2 ;Const cube = 2 ;Const cam = 2 MoveMouse 320,230 Repeat If KeyDown(203) Then TurnEntity cam, 0,+1.8,0 If KeyDown(205) Then TurnEntity cam, 0,-1.8,0 If KeyDown(200) Then MoveEntity cam, 0,0,+7 If KeyDown(208) Then MoveEntity cam, 0,0,-7 ;#=EntityX(cam) ;#=EntityY(cam) ;#=EntityZ(cam) ;erra_y#=TerrainY(terrain,x#,y#,z#)+4 ;ositionEntity cam,x#,terra_y#,z# ; CameraRange cam,0.001,1000 ; x=MouseXSpeed() ; If x>0 TurnEntity cam, 0 ,-x, 0 ; If x<0 TurnEntity cam, 0 ,-x, 0; ; y=MouseYSpeed() ; If y>0 TurnEntity cam, y ,0, 0 ; If y<0 TurnEntity cam, y ,0, 0 CameraRange cam,0.001,1000 Collisions cam,terrain,2,2 RenderWorld UpdateWorld ; col=CountCollisions(cube) ; Flip Until KeyHit(1)[/list] |
||
EKRITSel: Rechtschreibfehler sind gewollt um eure Aufmerksamkeit zutesten!
Magians vs. Nekromats 100% COMPLETE |
![]() |
dimaster |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hallo, so sollte es gehen:
Code: [AUSKLAPPEN] ; TERRAIN.BB groesse = 2048 Graphics3D 640,460 SetBuffer BackBuffer() cam = CreateCamera() PositionEntity cam, 20,45,20 font = LoadFont("Aria", 35,1,1,1) SetFont font EntityType cam, 1;cam kann nicht 1 sein wenn cube 1 ist Text 260,200,"Loading ..." AmbientLight 45,219,249 CameraClsColor cam,45,219,249 CameraFogColor cam,13,13,13 CameraFogRange cam,1,1 cube=CreateCube () cube_text=LoadTexture ("C:\Daten\Diverses\Downloads\text3.bmp") EntityTexture cube,cube_text PositionEntity cube, 1000,45,1000 ScaleEntity cube, 200,100,400 EntityType cube,2 EntityRadius cube,1 cube1=CreateCube () cube_text=LoadTexture ("C:\Daten\Diverses\Downloads\text3.bmp") EntityTexture cube1,cube_text PositionEntity cube1, 200,100,1120 ScaleEntity cube1, 120,100,400 EntityType cube1,2 EntityRadius cube1,1 terrain = CreateTerrain(groesse) textur = LoadTexture("C:\Daten\bilder\gras.bmp") EntityTexture terrain, textur For i=1 To groesse * groesse / 2 ModifyTerrain terrain, Rand(groesse), Rand(groesse), Rnd(-1,+1) Next EntityType terrain, 2 MoveMouse 320,230 Repeat collisions 1,2,2,2 If KeyDown(203) Then TurnEntity cam, 0,+1.8,0 If KeyDown(205) Then TurnEntity cam, 0,-1.8,0 If KeyDown(200) Then MoveEntity cam, 0,0,+7 If KeyDown(208) Then MoveEntity cam, 0,0,-7 ;#=EntityX(cam) ;#=EntityY(cam) ;#=EntityZ(cam) ;erra_y#=TerrainY(terrain,x#,y#,z#)+4 ;ositionEntity cam,x#,terra_y#,z# ; CameraRange cam,0.001,1000 ; x=MouseXSpeed() ; If x>0 TurnEntity cam, 0 ,-x, 0 ; If x<0 TurnEntity cam, 0 ,-x, 0; ; y=MouseYSpeed() ; If y>0 TurnEntity cam, y ,0, 0 ; If y<0 TurnEntity cam, y ,0, 0 CameraRange cam,0.001,1000 RenderWorld UpdateWorld ; col=CountCollisions(cube) ; Flip Until KeyHit(1) wenn du entitytype terrain , 2 und entitytype cam,1 musst dus so schreiben: collisions 1,2,2,2 du könntest es so schreiben wenns du übersichtlicher findest: const camera = 1 const terr = 2 .... .... entitytype cam,camera entitytype terrain,terr ... ... collisions camera,terr,2,2 .... ich hoffe das hilft dir gruss dimaster |
||
Ekrits |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Ja es hilft Thx | ||
EKRITSel: Rechtschreibfehler sind gewollt um eure Aufmerksamkeit zutesten!
Magians vs. Nekromats 100% COMPLETE |
Ekrits |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
und wie mach ich es mit cam und cube ???
Code: [AUSKLAPPEN] ; TERRAIN.BB groesse = 2048 Graphics3D 640,460 SetBuffer BackBuffer() cam = CreateCamera() PositionEntity cam, 20,60,20 font = LoadFont("Aria", 35,1,1,1) SetFont font EntityType cam, 2 Text 260,200,"Loading ..." AmbientLight 45,219,249 CameraClsColor cam,45,219,249 CameraFogColor cam,13,13,13 CameraFogRange cam,1,1 ;;;;;;;;;;;; ;CUBES;;;;;; ;;;;;;;;;;;; cube=CreateCube () cube_text=LoadTexture ("C:\Daten\Bilder\holz.jpg") EntityTexture cube,cube_text PositionEntity cube, 1000,45,1000 ScaleEntity cube, 100,100,100 EntityType cube,1 EntityRadius cube,1 textur = LoadTexture("C:\Daten\bilder\gras.bmp") boden = CreatePlane() EntityTexture boden, textur ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;BEWEGUNGEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MoveMouse 320,230 Repeat If KeyDown(203) Then TurnEntity cam, 0,+3,0 If KeyDown(205) Then TurnEntity cam, 0,-3,0 If KeyDown(200) Then MoveEntity cam, 0,0,+9 If KeyDown(208) Then MoveEntity cam, 0,0,-9 If KeyDown(203) Then TurnEntity ak47, 0,+3,0 If KeyDown(205) Then TurnEntity ak47, 0,-3,0 If KeyDown(200) Then MoveEntity ak47, 0,0,-9 If KeyDown(208) Then MoveEntity ak47, 0,0,+9 If KeyDown(56) Then MoveEntity ak47, +1.8,0,0 If KeyDown(157) Then MoveEntity ak47, -1.8,0,0 If KeyDown(157) Then MoveEntity cam, +1.8,0,0 If KeyDown(56) Then MoveEntity cam, -1.8,0,0 Collisions cam,cube,2,2 CameraRange cam,0.001,1000 RenderWorld UpdateWorld Flip Until KeyHit(1) |
||
EKRITSel: Rechtschreibfehler sind gewollt um eure Aufmerksamkeit zutesten!
Magians vs. Nekromats 100% COMPLETE |
![]() |
dimaster |
![]() Antworten mit Zitat ![]() |
---|---|---|
Also eigentlich gleich:
Code: [AUSKLAPPEN] ; TERRAIN.BB groesse = 2048 Graphics3D 640,460 SetBuffer BackBuffer() cam = CreateCamera() PositionEntity cam, 20,60,20 font = LoadFont("Aria", 35,1,1,1) SetFont font EntityType cam, 1 Text 260,200,"Loading ..." AmbientLight 45,219,249 CameraClsColor cam,45,219,249 CameraFogColor cam,13,13,13 CameraFogRange cam,1,1 ;;;;;;;;;;;; ;CUBES;;;;;; ;;;;;;;;;;;; cube=CreateCube () cube_text=LoadTexture ("C:\Daten\Bilder\holz.jpg") EntityTexture cube,cube_text PositionEntity cube, 1000,45,1000 ScaleEntity cube, 100,100,100 EntityType cube,3;3 weil sonst die gleiche kollision ist wie bei terrain kannst natürlich auch 2 nehmen EntityRadius cube,1 textur = LoadTexture("C:\Daten\bilder\gras.bmp") boden = CreatePlane() EntityTexture boden, textur ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;BEWEGUNGEN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MoveMouse 320,230 Repeat If KeyDown(203) Then TurnEntity cam, 0,+3,0 If KeyDown(205) Then TurnEntity cam, 0,-3,0 If KeyDown(200) Then MoveEntity cam, 0,0,+9 If KeyDown(208) Then MoveEntity cam, 0,0,-9 If KeyDown(203) Then TurnEntity ak47, 0,+3,0 If KeyDown(205) Then TurnEntity ak47, 0,-3,0 If KeyDown(200) Then MoveEntity ak47, 0,0,-9 If KeyDown(208) Then MoveEntity ak47, 0,0,+9 If KeyDown(56) Then MoveEntity ak47, +1.8,0,0 If KeyDown(157) Then MoveEntity ak47, -1.8,0,0 If KeyDown(157) Then MoveEntity cam, +1.8,0,0 If KeyDown(56) Then MoveEntity cam, -1.8,0,0 Collisions 1,3,2,2;warum haste hier wieder so geschrieben : collisions cam,cubes,2,2 solltest du net machen dann gehts net!!! CameraRange cam,0.001,1000 RenderWorld UpdateWorld Flip Until KeyHit(1) gruss dimaster |
||
Ekrits |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Vielen vielen Dank entlich funktioniert. Aber wenn ich gegen einen cube laufe dann kann ich hindurchsehen . | ||
EKRITSel: Rechtschreibfehler sind gewollt um eure Aufmerksamkeit zutesten!
Magians vs. Nekromats 100% COMPLETE |
![]() |
dimaster |
![]() Antworten mit Zitat ![]() |
---|---|---|
ich weiss nicht warum das so ist aber es ist halt einfach so | ||
Ekrits |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
macvht nichts hauptsache ich hab Kollisionen | ||
EKRITSel: Rechtschreibfehler sind gewollt um eure Aufmerksamkeit zutesten!
Magians vs. Nekromats 100% COMPLETE |
Ekrits |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Ich habs du man muss noch einen nur etwas kleiner in ihn rein setzten | ||
EKRITSel: Rechtschreibfehler sind gewollt um eure Aufmerksamkeit zutesten!
Magians vs. Nekromats 100% COMPLETE |
![]() |
dimaster |
![]() Antworten mit Zitat ![]() |
---|---|---|
naja so gehts natürlich | ||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group