Probleme mit erstelltem Mesh und Licht

Übersicht BlitzBasic Blitz3D

Neue Antwort erstellen

 

Zoppo_1

Betreff: Probleme mit erstelltem Mesh und Licht

BeitragDi, Jun 13, 2006 3:30
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich habe mit addvertex ein eigenes Mesh erstellt.
Danach habe ich mit einem Brush eine Farbe aufgetragen.

LOK_ub_netz=CreateMesh()
LOK_ub_oberfl=CreateSurface(LOK_ub_netz)

LOK_v1=AddVertex(LOK_ub_oberfl,-Lok_b/2,-Lok_h/2,-UB_Lang/2,0,0)
LOK_v2=AddVertex(LOK_ub_oberfl,Lok_b/2,-Lok_h/2,-UB_Lang/2,0,1)
LOK_v3=AddVertex(LOK_ub_oberfl,-lok_b/2,-Lok_h/2+Lok_t,-UB_Lang/2,1,0)
LOK_v4=AddVertex(LOK_ub_oberfl,-lok_s/2,-Lok_h/2+Lok_t,-UB_Lang/2,1,1)
LOK_v5=AddVertex(LOK_ub_oberfl,Lok_s/2,-Lok_h/2+Lok_t,-UB_Lang/2,0,0)
LOK_v6=AddVertex(LOK_ub_oberfl,Lok_b/2,-Lok_h/2+Lok_t,-UB_Lang/2,0,1)
LOK_v7=AddVertex(LOK_ub_oberfl,-lok_b/2,Lok_h/2-Lok_t,-UB_Lang/2,1,0)
LOK_v8=AddVertex(LOK_ub_oberfl,-lok_s/2,Lok_h/2-Lok_t,-UB_Lang/2,1,1)
LOK_v9=AddVertex(LOK_ub_oberfl,Lok_s/2,Lok_h/2-Lok_t,-UB_Lang/2,0,0)
LOK_v10=AddVertex(LOK_ub_oberfl,Lok_b/2,Lok_h/2-Lok_t,-UB_Lang/2,0,1)
LOK_v11=AddVertex(LOK_ub_oberfl,-Lok_b/2,Lok_h/2,-UB_Lang/2,0,0)
LOK_v12=AddVertex(LOK_ub_oberfl,Lok_b/2,Lok_h/2,-UB_Lang/2,0,1)

LOK_v13=AddVertex(LOK_ub_oberfl,-Lok_b/2,-Lok_h/2,UB_Lang/2,0,0)
LOK_v14=AddVertex(LOK_ub_oberfl,Lok_b/2,-Lok_h/2,UB_Lang/2,0,1)
LOK_v15=AddVertex(LOK_ub_oberfl,-lok_b/2,-Lok_h/2+Lok_t,UB_Lang/2,1,0)
LOK_v16=AddVertex(LOK_ub_oberfl,-lok_s/2,-Lok_h/2+Lok_t,UB_Lang/2,1,1)
LOK_v17=AddVertex(LOK_ub_oberfl,Lok_s/2,-Lok_h/2+Lok_t,UB_Lang/2,0,0)
LOK_v18=AddVertex(LOK_ub_oberfl,Lok_b/2,-Lok_h/2+Lok_t,UB_Lang/2,0,1)
LOK_v19=AddVertex(LOK_ub_oberfl,-lok_b/2,Lok_h/2-Lok_t,UB_Lang/2,1,0)
LOK_v20=AddVertex(LOK_ub_oberfl,-lok_s/2,Lok_h/2-Lok_t,UB_Lang/2,1,1)
LOK_v21=AddVertex(LOK_ub_oberfl,Lok_s/2,Lok_h/2-Lok_t,UB_Lang/2,0,0)
LOK_v22=AddVertex(LOK_ub_oberfl,Lok_b/2,Lok_h/2-Lok_t,UB_Lang/2,0,1)
LOK_v23=AddVertex(LOK_ub_oberfl,-Lok_b/2,Lok_h/2,UB_Lang/2,0,0)
LOK_v24=AddVertex(LOK_ub_oberfl,Lok_b/2,Lok_h/2,UB_Lang/2,0,1)

LOK_t1=AddTriangle(LOK_ub_oberfl,LOK_v1,LOK_v3,LOK_v6)
LOK_t2=AddTriangle(LOK_ub_oberfl,LOK_v1,LOK_v6,LOK_v2)
LOK_t3=AddTriangle(LOK_ub_oberfl,LOK_v4,LOK_v8,LOK_v9)
LOK_t4=AddTriangle(LOK_ub_oberfl,LOK_v4,LOK_v9,LOK_v5)
LOK_t5=AddTriangle(LOK_ub_oberfl,LOK_v7,LOK_v11,LOK_v12)
LOK_t6=AddTriangle(LOK_ub_oberfl,LOK_v7,LOK_v12,LOK_v10)

LOK_t7=AddTriangle(LOK_ub_oberfl,LOK_v18,LOK_v15,LOK_v13)
LOK_t8=AddTriangle(LOK_ub_oberfl,LOK_v14,LOK_v18,LOK_v13)
LOK_t9=AddTriangle(LOK_ub_oberfl,LOK_v21,LOK_v20,LOK_v16)
LOK_t10=AddTriangle(LOK_ub_oberfl,LOK_v17,LOK_v21,LOK_v16)
LOK_t11=AddTriangle(LOK_ub_oberfl,LOK_v24,LOK_v23,LOK_v19)
LOK_t12=AddTriangle(LOK_ub_oberfl,LOK_v22,LOK_v24,LOK_v19)

LOK_t13=AddTriangle(LOK_ub_oberfl,LOK_v11,LOK_v23,LOK_v24)
LOK_t14=AddTriangle(LOK_ub_oberfl,LOK_v11,LOK_v24,LOK_v12)

LOK_t15=AddTriangle(LOK_ub_oberfl,LOK_v10,LOK_v12,LOK_v24)
LOK_t16=AddTriangle(LOK_ub_oberfl,LOK_v10,LOK_v24,LOK_v22)

LOK_t17=AddTriangle(LOK_ub_oberfl,LOK_v22,LOK_v21,LOK_v9)
LOK_t18=AddTriangle(LOK_ub_oberfl,LOK_v10,LOK_v22,LOK_v9)

LOK_t19=AddTriangle(LOK_ub_oberfl,LOK_v5,LOK_v9,LOK_v21)
LOK_t20=AddTriangle(LOK_ub_oberfl,LOK_v5,LOK_v21,LOK_v17)

LOK_t21=AddTriangle(LOK_ub_oberfl,LOK_v5,LOK_v17,LOK_v18)
LOK_t22=AddTriangle(LOK_ub_oberfl,LOK_v5,LOK_v18,LOK_v6)

LOK_t23=AddTriangle(LOK_ub_oberfl,LOK_v2,LOK_v6,LOK_v18)
LOK_t24=AddTriangle(LOK_ub_oberfl,LOK_v2,LOK_v18,LOK_v14)

LOK_t25=AddTriangle(LOK_ub_oberfl,LOK_v14,LOK_v13,LOK_v1)
LOK_t26=AddTriangle(LOK_ub_oberfl,LOK_v2,LOK_v14,LOK_v1)




ent_1=CopyEntity(LOK_ub_netz)
brush=CreateBrush()
BrushColor brush,250,0,0
BrushFX brush,2
PaintMesh ent_1,brush

FreeEntity LOK_ub_netz

Das Mesh wird richtig dargestellt, und die Farbe ist auch drauf. Nun müssten sich aber helle und dunkele Flächen ergeben (durch das Licht). Ein parallel hierzu erzeugter Cube hat diese auch. Nur mein Mesh ist einer Farbe (dunkeles rot) wie die nicht beleuchteten Flächen des Würfels.

Wer kann mir weiterhelfen?

x-pressive

BeitragDi, Jun 13, 2006 8:23
Antworten mit Zitat
Benutzer-Profile anzeigen
Versuch es mal mit UpdateNormals nachdem du dein Mesh erstellt hast. Könnte daran liegen.
• BLITZ SHOWCASE:
PARTICLE CANDY • PARTICLE CANDY FOR iPHONE • SPRITE CANDY • DON'T GET ANGRY! 2-3 • CLICK CLACK XL
 

Zoppo_1

BeitragDi, Jun 13, 2006 8:56
Antworten mit Zitat
Benutzer-Profile anzeigen
Danke für die schnelle Hilfe

Neue Antwort erstellen


Übersicht BlitzBasic Blitz3D

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group