Problem mit Collisions
Übersicht

SamqBetreff: Problem mit Collisions |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Und zwar hab ich ein kleines Problem mit der Collision, sie geht zwar aber man kann trotzdem wenn man nach links und rechts sich bewegt reinschauen.... das sieht echt doof aus.
Über hilfe würde ich mich freuen. Code: [AUSKLAPPEN] Graphics3D 640,480 SetBuffer BackBuffer() camera=CreateCamera() EntityType camera,type_camera PositionEntity camera,0,1,-10 CameraClsColor camera,190,185,180 CameraFogColor camera,180,175,170 type_cube=2 type_cube1=2 type_plane=2 type_camera=1 light=CreateLight() RotateEntity light,90,0,0 plane=CreatePlane() grass_tex=LoadTexture("gfx/greygrass.bmp") EntityTexture plane,grass_tex EntityType plane,type_plane EntityAlpha plane,0.5 mirror=CreateMirror() b745=LoadMesh ("2.3DS") ScaleEntity b745, 0.02, 0.02, 0.02 ; 500 EntityType b745,type_cube1 PositionEntity b745, 10, 0, 0 cube=CreateCube() cube_tex=LoadTexture("gfx/greywater.bmp") EntityTexture cube,cube_tex EntityType cube,type_cube RotateEntity light,30,20,10 PositionEntity cube,0,2,0 EntityPickMode cube,2 EntityType camera,type_camera EntityType cube,type_cube EntityType b745,type_cube1 EntityType plane,type_plane Collisions type_camera,type_cube,2,2 Collisions type_camera,type_cube1,2,2 Collisions type_camera,type_plane,2,2 microphone=CreateListener(camera) sound=Load3DSound("snd/muse.mp3") While Not KeyHit(1) x#=0 y#=0 z#=0 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.05 If KeyDown(200)=1 Then MoveEntity camera,0,0,0.05 mx=MouseX() my=MouseY() entity=CameraPick(camera,mx,my) If entity=0 Then EntityColor cube,255,255,255 If entity<>0 Then EntityColor cube,0,255,0 RenderWorld If entity=0 Then Text 0,0,"Nicht ausgewählt" If entity<>0 Then Text 0,0,"Ausgewählt:"+entity Oval mx-0,my-1,1,1,1 MoveEntity camera,x#,0.-2,z# Collisions 1,2,2,2 If MouseHit(1) =1 Then EmitSound(sound,cube) If KeyDown (30) Then chnBackground=PlayMusic("snd/1.mp3") EndIf If KeyDown (48) chnBackground=PlayMusic("snd/2.wav") EndIf If KeyDown (46) chnBackground=PlayMusic("snd/3.wav") EndIf If KeyDown (32) chnBackground=PlayMusic("snd/4.wav") EndIf If KeyDown (18) chnBackground=PlayMusic("snd/5.wav") EndIf If KeyDown (33) chnBackground=PlayMusic("snd/6.wav") EndIf If KeyDown (34) chnBackground=PlayMusic("snd/7.wav") EndIf If KeyDown (35) chnBackground=PlayMusic("snd/8.wav") EndIf If KeyDown (23) chnBackground=PlayMusic("snd/9.wav") EndIf If KeyDown (36) chnBackground=PlayMusic("snd/10.wav") EndIf If KeyDown (37) chnBackground=PlayMusic("snd/11.wav") EndIf If KeyDown (38) chnBackground=PlayMusic("snd/12.wav") EndIf If KeyDown (50) chnBackground=PlayMusic("snd/13.wav") EndIf If KeyDown (49) chnBackground=PlayMusic("snd/14.wav") EndIf If KeyDown (24) chnBackground=PlayMusic("snd/15.wav") EndIf If KeyDown (25) chnBackground=PlayMusic("snd/16.wav") EndIf If KeyDown (16) chnBackground=PlayMusic("snd/17.wav") EndIf UpdateWorld RenderWorld Text 0,0,"Benutze Cursortasten zum Verschieben" Text 0,20,"Mit linker Maustaste Sound abspielen" Flip Wend End |
||
![]() |
FreakForFreedom |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hm, ist eine ganze Weile her, dass ich B3D gemacht habe, aber wenn ich mich richtig erinnere, wird mit "EntityType camera,type_camera" nur der pivot, der sich auf der Position der Kamera befindet, zu den Kollisionen hinzu gezählt.
Was du aber machen kannst, ist eine unsichtbare Surface direkt vor die Kamera zu packen, diese als Child/Parent an die Kamera binden und die Surface dann zu den Kollisionsabfragen hinzufügen. So sollte man dann auch korrekt mit den Wänden kollidieren können. ![]() |
||
Mfg
F.F.F. "Try and ERROR!" |
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Für die Kamerakollision musst du eine Alpha 0 Kugel machen an welche du die Kamera parentest und dann dieser Kollision geben.
Ist die schnellste Variante für eine "simple" Kollision. Dabei ist zu beachten, dass diese Kugel grösser sein muss als sqrt(2) * minimaleKameraRange sonst wirst du an den Ecken beim drehen recht hässliche effekte erhalten weil du streifenweise durchschauen kannst |
||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
![]() |
Markus2 |
![]() Antworten mit Zitat ![]() |
---|---|---|
Oder EntityRadius ? | ||
Dreamora |
![]() Antworten mit Zitat ![]() |
|
---|---|---|
Geht auch | ||
Ihr findet die aktuellen Projekte unter Gayasoft und könnt mich unter @gayasoft auf Twitter erreichen. |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group