Kollision und transparente Texturen
Übersicht

![]() |
BlitzproggerBetreff: Kollision und transparente Texturen |
![]() Antworten mit Zitat ![]() |
---|---|---|
Hallo erstmal,
Ich habe mich nun endlich an das 3d Programmieren rangewagt und stehe schon jetzt an zwei Problemen: 1. Bäume werden falsch angezeigt - d.h. : Ich habe die Texturen alle in einer einzigen zusammengepappt und als .tga gespeichert. In Ms3d wird alles richtig dargestellt, aber in meinem Programm werden die "eigentlich" transparenten Stellen mit angezeigt. 2. Ich habe versucht, meine Objekte mittels "EntityType" einem Typ zuzuordnen und diese mit dem Spieler kollidieren zu lassen - was aber leider nicht funktioniert. Der Spieler gleitet einfach gemütlich durch alles hindurch. Hier noch den Code: [AUSKLAPPEN] Graphics3D 1280,1024,32,2
SetBuffer BackBuffer () Const playercol=1 Const worldcol=2 Const scrollmax=3 cmz=MouseZ() mz=cmz timer = CreateTimer (60) player = CreateSphere () EntityColor player,255,0,0 PositionEntity player,0,5,0 ScaleEntity player,1,2.5,1 viewpp = CreatePivot (player) ; viewpp = viewpivotplayer PositionEntity viewpp,0,1,0 EntityType player,playercol Dim tree (100) For i = 0 To 100 tree(i) = LoadMesh ("data\gfx\baum1_v2.b3d") PositionEntity tree(i),Rand (-100,100),0,Rand (-100,100) RotateEntity tree(i),0,Rand (0,360),0 EntityType tree(i),worldcol Next land = CreatePlane () PositionEntity land,0,0,0 landtex = LoadTexture ("data\gfx\gras.jpg") ScaleTexture landtex,50,50 EntityTexture land,landtex EntityType land,worldcol air = CreateSphere (10,player) PositionEntity air,0,0,0 ScaleEntity air,-750,-750,-750 cam = CreateCamera (viewpp) PositionEntity cam,-2,0.25,0 PointEntity cam,viewpp While Not KeyHit (1) ;Cls If KeyDown(16) Then w=w+1 If KeyDown(18) Then w=w-1 While w >= 360 w=w-360 Wend RotateEntity player,0,w,0 movex#=0 movey#=0 If KeyDown(17) Then xp=xp+Cos#(w) : yp=yp+Sin#(w) : movex# = 0.25 If KeyDown(30) Then xp=xp-Cos#(w) : yp=yp+Sin#(w) : movey# = 0.25 If KeyDown(31) Then xp=xp-Cos#(w) : yp=yp-Sin#(w) : movex# = -0.25 If KeyDown(32) Then xp=xp+Cos#(w) : yp=yp-Sin#(w) : movey# = -0.25 Collisions playercol,worldcol,2,2 ;PositionEntity player,xp,5,yp MoveEntity player,movex#,0,movey# mzs=MouseZSpeed() ;mz-MouseZ() mz=mz+mzs;MouseZ() If cmz-mz >=scrollmax Then mzs = 0 : mz=(scrollmax-1)*-1 If cmz-mz <=(scrollmax)*-1 Then mzs = 0 : mz=scrollmax-1 If Abs(mzs) >=1 Then MoveEntity cam,o,0,mzs xp = EntityX(player) yp = EntityY(player) zp = EntityZ(player) RenderWorld () WaitTimer timer Text 0,0 ,xp;+" , "+(xp) Text 0,20,yp;+" , "+(yp) Text 0,40,zp Flip Wend End mfg |
||
Mein aktuelles Projekt, Irnithal: http://www.blitzforum.de/worklogs/415/
Unfreiwilliger Gewinner des BAC# 115. ![]() |
![]() |
Tankbuster |
![]() Antworten mit Zitat ![]() |
---|---|---|
Updateworld![]() ![]() |
||
Twitter
Download Jewel Snake! Windows|Android |
![]() |
Blitzprogger |
![]() Antworten mit Zitat ![]() |
---|---|---|
Vielen Dank. ![]() mfg |
||
Mein aktuelles Projekt, Irnithal: http://www.blitzforum.de/worklogs/415/
Unfreiwilliger Gewinner des BAC# 115. ![]() |
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group