Camera collision.......camera steuerung.....

Übersicht BlitzBasic Beginners-Corner

Neue Antwort erstellen

Jo0oker

Betreff: Camera collision.......camera steuerung.....

BeitragMo, Feb 05, 2007 19:52
Antworten mit Zitat
Benutzer-Profile anzeigen
Hallo leute ich habe ein Problem mit meiner camera steuerung unzwaer wenn ich ein bischen nach vorne gehe dann dreht sich die camera um einen anderen winkel.......
und die camera collediert auch nicht den boden sonder fällt einfach durch.

Code: [AUSKLAPPEN]

Graphics3D 1024,768,32,0
SetBuffer BackBuffer()

light = CreateLight()
Global pivot= CreatePivot()
Global camera=CreateCamera(pivot)
Global glas = LoadImage("glas.bmp")
 PositionEntity camera,0,50,2
Global First_1 = LoadImage("first_view.bmp")
Global sphere = LoadMesh("map.3ds")
 PositionEntity sphere ,-0.5,45,0
MaskImage First_1,0,255,0
MaskImage glas,0,255,0


Global pistole = LoadMesh("Colt\gun2.3ds",camera)
PositionEntity pistole,-1,-0.8,1.9
ScaleEntity pistole,.1,.1,.1
TurnEntity pistole,0,270,0

MoveMouse GraphicsWidth()/2 , GraphicsHeight()/2
ScaleEntity sphere,0.9,0.9,0.9

;EntityParent pistole,camera,0

Global muni
muni = 15

EntityType sphere,K_M
EntityType camera,K_P

Local camVSspe#
;Global mag = 3
TurnEntity pistole,-90,180,0

While Not KeyHit(1)




 movep# = movep# - .1
If movep#>6 Then MoveEntity pistole,0,0,0.001
 
If movep#<6 Then MoveEntity pistole,0,0,-0.001

If movep# < -.1  Then movep#= movep # + 11







If EntityCollided(camera,K_M) Then
camVSspe = 0
PositionEntity camera,EntityX(camera),EntityY(camera),EntityZ(camera)
Else
camVSspe = (camVSspe - 0.015) * 0.999
PositionEntity camera,EntityX(camera),EntityY(camera)+pVy,EntityZ(camera)
End If


If KeyDown(57) And camVSspe = 0 Then camVSspe = .3





laufen()
maus()
RenderWorld
zaeler()
Text 400,15,("Munition " + muni)
Text 490,15,("Magazine " + mag)




DrawImage First_1 ,0,0         

Flip
Wend
End

Function maus()

moux# = MouseXSpeed()
mouy# = MouseYSpeed()
 TurnEntity pivot,0,-moux/7,0
TurnEntity camera,mouy/6,0,0
MoveMouse GraphicsWidth()/2 , GraphicsHeight()/2
  AlignToVector camera,EntityX(pivot),EntityY(pivot),EntityZ(pivot),0



End Function

Function laufen()
If KeyDown(17) Then MoveEntity camera,0,0,0.5
 If KeyDown(31) Then MoveEntity camera,0,0,-0.5
 If KeyDown(32) Then MoveEntity camera,0.5,0,0
 If KeyDown(30) Then MoveEntity camera,-0.5,0,0










End Function

Function zaeler()
If MouseHit(1) Then muni = muni - 1
If muni < 0 Then muni = 0
If KeyHit(19)  Then muni = 15
If KeyHit(19) Then mag = mag - 1

If MouseDown(1) Then MoveEntity pistole,0,0,0.1
  If MouseDown(1) Then MoveEntity pistole,0,0,-0.1



End Function





er ist noch ein wenig unordentlich.



lg Jo0oker
Tehadon, das kostenlose 3D RPG
www.tehadon.de
http://www.blitzforum.de/worklogs/14/
Das Abenteuer wird beginnen!

Jo0oker

BeitragMo, Feb 05, 2007 21:07
Antworten mit Zitat
Benutzer-Profile anzeigen
Wenn ihr nicht wisst was ich meine dann sagt es mir bitte Exclamation


lg Jo0oker
Tehadon, das kostenlose 3D RPG
www.tehadon.de
http://www.blitzforum.de/worklogs/14/
Das Abenteuer wird beginnen!

the FR3AK

BeitragMo, Feb 05, 2007 21:11
Antworten mit Zitat
Benutzer-Profile anzeigen
1.Du musst deinem Pivot auch nen Kollisionstyp zuweisen...also EntityType Pivot,Player

2.Wenn du nach vorne gehst musst du deinen Pivot bewegen nicht die Kamera!

Jo0oker

BeitragMo, Feb 05, 2007 22:12
Antworten mit Zitat
Benutzer-Profile anzeigen
Wenn ich nur den Pivot nach vorne bewege dann sieht das auch nicht besser aus.
.......

lg Jo0oker
Tehadon, das kostenlose 3D RPG
www.tehadon.de
http://www.blitzforum.de/worklogs/14/
Das Abenteuer wird beginnen!

the FR3AK

BeitragDi, Feb 06, 2007 19:56
Antworten mit Zitat
Benutzer-Profile anzeigen
Vll hast du den Pivot nicht richtig als Parent von der Kamera angegeben...

NightPhoenix

BeitragDi, Feb 06, 2007 20:20
Antworten mit Zitat
Benutzer-Profile anzeigen
updateworld() fehlt im code!
kann auch sein dass ichs nicht gesehen habe falls es doch drin steht ^^

Jo0oker

BeitragDi, Feb 06, 2007 20:44
Antworten mit Zitat
Benutzer-Profile anzeigen
Habe den fehler gefunden.
das fehlte ne mänge im code. die eigendlliche collision fehlte und das mit dem aligntovector war nicht so gut.


lg Jo0oker
Tehadon, das kostenlose 3D RPG
www.tehadon.de
http://www.blitzforum.de/worklogs/14/
Das Abenteuer wird beginnen!

Neue Antwort erstellen


Übersicht BlitzBasic Beginners-Corner

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group