pickedY bei terrain

Übersicht BlitzBasic Blitz3D

Neue Antwort erstellen

 

Boris1993

Betreff: pickedY bei terrain

BeitragSa, Jul 03, 2010 17:03
Antworten mit Zitat
Benutzer-Profile anzeigen
hallo
ich habe ein problem mit pickedY
wenn ich mit pickedX die x koordinate des terrains rausbekommen will klappt das einwandfrei
aber mit pickedY klappt das aus irgendeinem grund nicht
hier der code damit ihr wisst was ich meine:
Code: [AUSKLAPPEN]
Graphics3D 1024, 768, 32, 2
SetBuffer BackBuffer()

Global pointer
Global cam
Global mx
Global my
Global mxs#
Global mys#
Global mzs#
Global cx#
Global cz#
Global cxr#
Global cyr#

cam = CreateCamera()
PositionEntity cam, 0, 10, 0

licht = CreateLight()
RotateEntity licht, 45, 30, 0
AmbientLight 30, 30, 30

terrain = CreateTerrain(64)
TerrainDetail terrain, 50000, 1
ScaleEntity terrain, 1, 1, 1
TerrainShading terrain, 1
EntityPickMode terrain, 2

pointer = LoadImage("gfx\pointer.bmp")
HandleImage pointer, 4, 0
MaskImage pointer, 255, 0, 255

HidePointer

Repeat
   RenderWorld()
   
   maus()
   navigation()
   cp = CameraPick(cam, mx, my)
   px = PickedX()
   py = PickedY()
   Text 10, 10, cp
   Text 10, 30, px
   Text 10, 50, py
   If GetMouse() = 1 Then
      ModifyTerrain terrain, px, py, 1
   End If
   
   Flip
Until KeyHit(1)

EndGraphics
End

Function maus()
   mx = MouseX()
   my = MouseY()
   mxs = MouseXSpeed()
   mys = MouseYSpeed()
   mzs = MouseZSpeed()
End Function

Function navigation()
   If MouseDown(2) Then
      MoveMouse 1024 / 2, 768 / 2
      cxr = cxr + mys/5
      cyr = cyr + mxs/5
      If cxr > 90 Then
         cxr = 90
      Else If cxr <-90 Then
         cxr =-90
      End If
      RotateEntity cam, cxr,-cyr, 0
   Else
      DrawImage pointer, mx, my
   End If
   
   cx = 0
   cz = 0
   
   If KeyDown(17) cz = 1
   If KeyDown(30) cx =-1
   If KeyDown(31) cz =-1
   If KeyDown(32) cx = 1
   
   If mzs <> 0 Then
      cz = mzs
   End If
   
   MoveEntity cam, cx, 0, cz
End Function


schonmal danke für eure antworten

Silver_Knee

BeitragMo, Jul 05, 2010 1:14
Antworten mit Zitat
Benutzer-Profile anzeigen
ich glaube modifyterrain braucht die x und z koordinate und nicht die y-koordinate(=höhe an der gepickten stelle)
 

Boris1993

BeitragSa, Jul 10, 2010 20:06
Antworten mit Zitat
Benutzer-Profile anzeigen
danke ich versuchs gleich mal...
jop stimmt ist ja auch iwie logisch manchmal hab ich voll die denkfehler

Neue Antwort erstellen


Übersicht BlitzBasic Blitz3D

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group