GLBasic forum

Other languages => GLBasic - de => Topic started by: WPShadow on 2009-Oct-03

Title: 3D Schatten
Post by: WPShadow on 2009-Oct-03
Hi!

Ich komme irgendwie mit dem 3D - Schattenwurf nicht klar!

Grundlegend gehe ich genau nach Gernots Eintrag im HELP vor, nur sehe ich keinen Schattenwurf...

Seltsamerweise funzt das nicht so richtig!

Code (glbasic) Select

WHILE TRUE


MOUSESTATE mx, my, b1, b2

X_MAKE2D

PRINT mx + " " + my, 0, 0



X_MAKE3D 1, 1000, 45

X_CAMERAUP 0, 1, 0
X_CAMERA 50, 50, 50, 0, 0, 0

X_MIPMAPPING TRUE

X_SPOT_LT 1, RGB(255, 255, 255), 0 + mx, 10, 0 + my, 0, 0, 0, 360

draw_brett()

X_MOVEMENT 24, 0, 0
X_SETTEXTURE 2, -1
X_DRAWOBJ 2, 0


X_SPOT_LT -3, 0, 0, 10, 0, 0, 0, 0, 360

X_MOVEMENT 24, 0, 0
X_SETTEXTURE 2, -1
X_DRAWOBJ 2, 0

X_MAKE2D



SHOWSCREEN
WEND


Mache ich da irgendwas falsch?

Gruß

W.
Title: Re: 3D Schatten
Post by: Hemlos on 2009-Oct-03
Shadows are tricky.

1. objects cant be touching.
2. Objects faces must be a few position coordinates from each other. Small gaps create issues.
3. holes in an object might create problem too.
4. objects must be at least 1 or 2 coordinate wide, too small and issue arise.

I got them to work before, but it took alot of trial and error.
Title: Re: 3D Schatten
Post by: WPShadow on 2009-Oct-03
There are only small cubes and small objects on it, but no shadow, whatever I do...
Title: Re: 3D Schatten
Post by: Kitty Hello on 2009-Oct-03
After X_SPOLT_LT -3 you must draw all objects that cast a shadow.
Before that you must draw all objects that are in the scene to display the shadows.
Title: Re: 3D Schatten
Post by: WPShadow on 2009-Oct-03
That's exactly what I've done, but no shadow!

If you want, I can send you the file as example!

Don't want to show it, it's for the new Contest...  :nana:
Title: Re: 3D Schatten
Post by: Schranz0r on 2009-Oct-05
Schicks mir mal, dann schau ich es mir an.
Title: Re: 3D Schatten
Post by: WPShadow on 2009-Oct-05
kk, schon auf dem Weg!!!
Title: Re: 3D Schatten
Post by: Kitty Hello on 2009-Oct-05
PAck mal das projekt oder mach Objekte mit X_OBJ..., damit ich's schneller testen kann.
Title: Re: 3D Schatten
Post by: Schranz0r on 2009-Oct-06
Hast X_CULLMODE vergessen Willi!


machst du so :
Code (glbasic) Select

...
  X_MAKE3D 1, 1000, 45
   draw_camera(br)
    X_MIPMAPPING TRUE
    X_CULLMODE 1
...



ZITAT HILFE GLB (F1):
QuoteSpezialitäten Mit X_SPOT_LT erzeugt man Lichtquellen für Spezialeffekte. Dabei ist num# entscheidend für den Effekt.
Achtung
Dabei muss der CULLMODE auf -1 oder 1 stehen!

so, das wär mal wieder ein Bier :D
Title: Re: 3D Schatten
Post by: Kitty Hello on 2009-Oct-06
Krass. Das siehst Du einfach so!?
Title: Re: 3D Schatten
Post by: Schranz0r on 2009-Oct-06
Warum net?
Bin spezial GLB-User ;) , kein problem für mich  :whistle: ...

Ne hab einfach mal beim Spotlight auf F1 gehauen und schnell bei SPEZIALITÄTEN gelesen :D
Title: Re: 3D Schatten
Post by: WPShadow on 2009-Oct-06
Gut zu wissen, habe schon alles eingebaut! Sieht super aus!

Danke für die schnelle Hilfe!!!