In fact, "Ezbe" came up with a solution - no need to use the 'parent' command - that was what was throwing me in your example.
Doing it this way the shadows appear softer and the faces have a bit of flicker to them. But altering 'gShadowColor' for both actors allows you to scale it (0.6 for example) - It's nice that the actors can have their own individual strength of shadow.
Doing it this way the shadows appear softer and the faces have a bit of flicker to them. But altering 'gShadowColor' for both actors allows you to scale it (0.6 for example) - It's nice that the actors can have their own individual strength of shadow.
;===================================================== ; Basic GL For BlitzBasic © 2004 ; Creator: Albert Khakimov (arkon) - arkon@... ; Sample: Shadow ; Version: 0.1 ; Author: Korolyov Sergey (ventru) - ventrual@... ; Date: 13.11.04 ;===================================================== Include "../../Constants.bb" Include "../../keycodes.bb" Global Camera, Light, Plane Global Actor, Actor_Weapon, Actor_Shadow ;3d Graphics initialization ;gInitGraphics(640, 480, 32, 0, 0) gInitGraphics(1024, 768, 16, 0, 0) ;Adjust buffer options gBufferOptions 1, 1, 1, 0, 0, 0, 0, 0, 0 gCreateText 1, 18, "Press Left or Right key to rotate actor", 0, 0, 0, 0 ;S C E N E ;------------------------------------------------------------------------ gAmbientColor 1, 1, 1 ;Methods of scene sorting And culling gSceneSorting 1 gSceneCulling 3 ;Create Camera Camera = gDefaultCamera() gSetPosition Camera, 60, 30, 40 gSetDepthOfView Camera, 200 ;Create Light Light = gCreateLight(0) gSetPosition Light, 50, 100, 50 ;Crea Plane Plane = gCreatePlane(200, 200, 0) gSetAbsDir Plane, 0, 1, 0 gSetPosition Plane, 0, -24, 0 gPlaneTiles Plane, 5, 5 gLoadObjectTexture Plane, "../../media/back1.jpg" gObjTextureMode Plane, 1 ;Crea Plane Plane2 = gCreatePlane(200, 200, 0) gSetAbsDir Plane2, 0, 0, 1 gSetPosition Plane2, 0, 0, -22 gPlaneTiles Plane2, 5, 5 gLoadObjectTexture Plane2, "../../media/back1.jpg" gObjTextureMode Plane2, 1 ;Crea Plane Plane3 = gCreatePlane(200, 200, 0) gSetAbsDir Plane3, 1, 0, 0 gSetPosition Plane3, -22, 0, 0 gPlaneTiles Plane3, 5, 5 gLoadObjectTexture Plane3, "../../media/back1.jpg" gObjTextureMode Plane3, 1 ;A C T O R S ;------------------------------------------------------------------------ ;Load Actor Actor = gCreateActor("../../media/md2/tris.md2", 0) gSetAbsDir Actor, 0, 1, 0 gSetAbsUp Actor, 0, 0, -1 gLoadObjectTexture Actor, "../../media/md2/skin.jpg" gAnimationInterval Actor, 200 gAnimationMode Actor, 2 gSetTargetObject Camera, Actor ;Load Actor Weapon Actor_Weapon = gCreateActor("../../media/md2/weapon.md2", Actor) gLoadObjectTexture Actor_Weapon, "../../media/md2/weapon.jpg" gSetAnimations Actor_Weapon, Actor gAnimationInterval Actor_Weapon, 200 gSyncronize Actor_Weapon, Actor ;Create Actor Shadow Actor_Shadow = gCreateShadowVolume(0) gAddShadowCaster Actor_Shadow, Actor, 0 gAddShadowCaster Actor_Shadow, Actor_Weapon, 0 gAddShadowLight Actor_Shadow, Light, 0 gShadowMode Actor_Shadow, 1 gShadowColor Actor_Shadow, 0, 0, 0, 0.5 gShadowOptions Actor_Shadow, 0, 1, 0, 0 ;Load Actor Actor2 = gCreateActor("../../media/md2/tris.md2", 0) gSetPosition actor2,0,0,30 gSetAbsDir Actor2, 0, 1, 0 gSetAbsUp Actor2, 0, 0, -1 gLoadObjectTexture Actor2, "../../media/md2/skin.jpg" gAnimationInterval Actor2, 200 gAnimationMode Actor2, 2 gSetTargetObject Camera, Actor2 ;Load Actor Weapon Actor_Weapon2 = gCreateActor("../../media/md2/weapon.md2", Actor2) gLoadObjectTexture Actor_Weapon2, "../../media/md2/weapon.jpg" gSetAnimations Actor_Weapon2, Actor2 gAnimationInterval Actor_Weapon2, 200 gSyncronize Actor_Weapon2, Actor2 ;Create Actor Shadow Actor_Shadow2 = gCreateShadowVolume(0) gAddShadowCaster Actor_Shadow2, Actor2, 0 gAddShadowCaster Actor_Shadow2, Actor_Weapon2, 0 gAddShadowLight Actor_Shadow2, Light, 0 gShadowMode Actor_Shadow2, 1 gShadowColor Actor_Shadow2, 0, 0, 0, 0.5 gShadowOptions Actor_Shadow2, 0, 1, 0, 0 While gKeyHit(KEY_ESCAPE) = 0 And gProgress() = 1 If gKeyDown(KEY_LEFT) Then gRoll Actor, -1 If gKeyDown(KEY_RIGHT) Then gRoll Actor, 1 newTime# = gGetNewTime() gSetPosition Light, Sin(newTime#) + 10, 100, 40 Wend gCloseGraphics()