Ich sehe meine Kugel nicht^^
Übersicht
BlitzBasic
Beginners-Corner
MorpheusBetreff: Ich sehe meine Kugel nicht^^ |
Antworten mit Zitat |
|
|---|---|---|
|
Code: [AUSKLAPPEN] Graphics3D 1280,1024,16,1 SETBUFFER BACKBUFFER() camera=CreateCamera() cx#=0 cy#=15 cz#=-10 RotateEntity camera,45,0,0 PositionEntity camera,cx,cy,cz CameraRange camera,1,1000 light=CreateLight() RotateEntity light,45,0,0 sphere=CREATESPHERE(32) Global x#=0 Global y#=0 Global z#=0 EntityType sphere,1 EntityRadius sphere,1 PositionEntity sphere,x#,y#,z# EntityShininess sphere,1 plane=CreatePlane() plx#=0 ply#=-5 plz#=0 EntityType plane,1 EntityColor plane,0,100,0 PositionEntity plane,plx,ply,plz ScaleEntity plane,10,10,10 EntityShininess plane,1 cylinder=CreateCylinder(32) EntityType cylinder,1 EntityColor cylinder,255,0,0 PositionEntity cylinder,1,6,0 ScaleEntity cylinder,2,2,2 EntityShininess cylinder,1 While Not KeyDown(1) TurnEntity light,0.00694444444,0,0 If KeyDown(203)=1 Then x#=-0.1 MoveEntity sphere ,x#,0,0 If KeyDown(205)=1 Then x#=0.1 MoveEntity sphere ,x#,0,0 If KeyDown(208)=1 Then z#=-0.1 MoveEntity sphere,0,0,z# If KeyDown(200)=1 Then z#=0.1 MoveEntity sphere,0,0,z# If KeyDown(57) =1 Then MoveEntity sphere,x#,2,z# If KeyDown (30) Then cz=cz+0.05 MoveEntity camera,0,0,cz If KeyDown (44) Then cz=cz-0.05 MoveEntity camera,0,0,-cz ;Physikengine MoveEntity sphere,x#,-0.25,z# Collisions 1,1,2,3 UpdateWorld RenderWorld col=CountCollisions(sphere) Text 0,0,"Kollision(en):" For i=1 To col Text 000,i*20,"Entity="+CollisionEntity(sphere,i) Text 150,i*20,"Surface="+CollisionSurface(sphere,i) Text 300,i*20,"Triangle="+CollisionTriangle(sphere,i) Next Flip Wend ClearWorld End Hier kann ich mit A/Y soviel zoomen wir ich will, ich sehe meine Kugel trotzdem nicht Auch wenn mir jetzt schon eine Wahnsinns Insel voll Bäumen und Bloom-Effekt im Kopf rumschwimmt, so bin ich doch noch immer ein Noob. EDIT: Das drehende Licht ist der Beweis, dass man auch als Anfänger schon einen primitiven Tag/Nachtwechsel hinkriegen kann MfG, Morpheus |
||
|
|
HolzchopfMeisterpacker |
Antworten mit Zitat |
|---|---|---|
|
Ich als B3D Noob hab mich mal eben daran versucht und tatsächlich 1. Du solltest die Plane nicht auch in Y-Richtung (also Höhe) skalieren. Das hat zur Folge, dass die Kugel von Beginn an im Plane drin liegt und daher nichtmehr kollidiert. 2. Für die Sphere Kollisionstyp 1 verwenden, für alles andere würd ich Kollisionstyp 2 nehmen. Collisions nicht vergessen 3. Falls du auf Punkt 2 nicht verzichten kannst, dann musst du unbedingt einmal UpdateWorld ausführen, bevor du Collisions anwendest, sonst kann nämlich die Plane nicht verschoben werden (klingt komisch, scheint aber so zu sein 4. Collisions brauchst du nur einmal anzuwenden (vor der Schleife) MfG |
||
|
Erledige alles Schritt um Schritt - erledige alles. - Holzchopf
CC BY ♫ BinaryBorn - Yogurt ♫ (31.10.2018) Im Kopf da knackt's und knistert's sturm - 's ist kein Gedanke, nur ein Wurm |
||
MorpheusBetreff: Nur einmal springen... |
Antworten mit Zitat |
|
|---|---|---|
|
Code: [AUSKLAPPEN] Graphics3D 1280,1024,16,1 SetBuffer BackBuffer() camera=CreateCamera() cx#=0 cy#=0 cz#=-10 RotateEntity camera,0,0,0 PositionEntity camera,cx,cy,cz CameraRange camera,1,10000 light=CreateLight() RotateEntity light,45,0,0 sphere=CreateCube() ;sphere!!!! Global spherey#=-5 EntityType sphere,1 EntityRadius sphere,1 PositionEntity sphere,0,spherey,10 EntityShininess sphere,1 plane=CreatePlane() EntityType plane,1 EntityColor plane,0,100,0 PositionEntity plane,0,-5,0 ScaleEntity plane,10,1,10 EntityShininess plane,1 cylinder=CreateCylinder(32) EntityType cylinder,1 EntityColor cylinder,255,0,0 PositionEntity cylinder,4,-5,0 ScaleEntity cylinder,2,2,2 EntityShininess cylinder,1 Collisions 1,1,2,2 EntityParent camera,sphere,1 sprung = 0 imsprung=0 While Not KeyDown(1);looooooooooooooooooooooooooooooooooooooooooooooop x#=0 y#=0 z#=0 TurnEntity light,0.00694444444,0,0;Sonnenlicht If KeyDown(203)=1 Then MoveEntity sphere ,-0.5,0,0 If KeyDown(205)=1 Then MoveEntity sphere ,0.5,0,0 If KeyDown(208)=1 Then MoveEntity sphere,0,0,-0.1 If KeyDown(200)=1 Then MoveEntity sphere,0,0,0.1 If KeyDown(57) And sprung = 0 Then MoveEntity sphere,0,1,0 If spherey>-5.0 Then sprung=1 If KeyDown (17) Then MoveEntity camera,0,0,0.1 If KeyDown (31) Then MoveEntity camera,0,0,-0.1 If KeyDown (30) Then MoveEntity camera,0,0.1,0 If KeyDown (44) Then MoveEntity camera,0,-0.1,0 ;Physikengine MoveEntity sphere,0,-0.25,0 UpdateWorld RenderWorld col=CountCollisions(sphere) Text 0,0,"Kollision(en):" For i=1 To col Text 000,i*20,"Entity="+CollisionEntity(sphere,i) Text 150,i*20,"Surface="+CollisionSurface(sphere,i) Text 300,i*20,"Triangle="+CollisionTriangle(sphere,i) Text 450,i*20,"Spherey= "+spherey Next Flip Wend ClearWorld End Ich schaffs einfach nicht, dass man nur einmal mit Space springen kann MfG, Morpheus |
||
|
|
garret |
Antworten mit Zitat |
|---|---|---|
|
Sprungvariable einfügen. Bei Leertastenbetätigung Sprung auf 1 und nur wenn Sprung 0 ist wird der Sprung realisiert, d.h. darf ein neuer Sprung erfolgen.
Also: If Keyhit(Leertaste) And Sprung=0 Sprung=1 If Sprung=1 Springen() Sprung=0 EndIf Einfach mal danach suchen, wie es in 2D realisiert wird. |
||
| >>nec aspera terrent<< (Auch Widerwärtigkeiten schrecken nicht) | ||
Übersicht
BlitzBasic
Beginners-Corner
Powered by phpBB © 2001 - 2006, phpBB Group
