Sprite3D engine with FX [cross-platform]

Share your advanced PureBasic knowledge/code with the community.
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re:

Post by jamirokwai »

eddy wrote:For the orbit FX I need to optimize the cosine calculation.

Could you test this code if you are a mac or linux user :?:
I need result for MAC PPC, MAC INTEL and LINUX

Code: Select all

CompilerIf #PB_Compiler_OS<>#PB_OS_Windows
   Debug "test MAC / LINUX" 
   a=-150
   Debug a%128 ; <----- result = 126
CompilerEndIf
Mac OS X 10.6, PB 4.31, x86: 106
Mac OS X 10.6, PB 4.40b2, x86: 106
Mac OS X 10.6, PB 4.40b2, PowerPC-compiled: -22
Regards,
JamiroKwai
User avatar
michel51
Enthusiast
Enthusiast
Posts: 290
Joined: Mon Nov 21, 2005 10:21 pm
Location: Germany

Re:

Post by michel51 »

eddy wrote:For the orbit FX I need to optimize the cosine calculation.

Could you test this code if you are a mac or linux user :?:
I need result for MAC PPC, MAC INTEL and LINUX

Code: Select all

CompilerIf #PB_Compiler_OS<>#PB_OS_Windows
   Debug "test MAC / LINUX" 
   a=-150
   Debug a%128 ; <----- result = 126
CompilerEndIf
Mac OS 10.4.11 (Tiger): PB Version 4.31PPC - result: -22
Mac OS 10.4.11 (Tiger): PB Version 4.40B2PPC - result: -22
michel51

Mac OS X Snow Leopard (10.6.8 ) Intel
PureBasic V 5.21(x64), V 5.22beta
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

modulo is not symmetric for MAC PPC.
Perhaps It's a bug. :?
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

v0.91 uploaded
:arrow: download : http://www.datafilehost.com/download-1c41509c.html

- layer FX
- more sprite FX

*obsolete : SetFXSpeed
*obsolete : SetFXtransition
*MAC PPC : some FXs don't work because of the FastCosine bug.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

v0.92 uploaded
:arrow: download : http://www.datafilehost.com/download-86f09acf.html
- deformation FX : SineSkew, Stretch, Perspective
- FX : orbit
- Minor bug fixed : FastCos, FastSin
- Optimized : RenderView, ScaleSprite

I noticed the sprite mesh faces are visible if the deformation is too big.

:idea: The next version will only support PB versions 4.40+. I plan to use MAP to load named parameters (e.g. path points, scale transitions,...).

Code: Select all

AddLayer(10, "MyTexture" ....)
CreateSCaleFX(100, "MyScaleOptions" ....)
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

W.I.P
  • add filter parameters :
    ClearSpriteFXs(Sprite, FilterFX=#PB_Ignore) ;// FilterFX=#FX_Move | #FX_Oscillation
    ClearLayerFXs(Layer, FilterFX=#PB_Ignore)
  • I found a cool website about easing equations : http://www.robertpenner.com/easing/ :idea:
    Now I can code FXs : MoveTo, RotateTo, ScaleTo :D
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

W.I.P
  • removed old code for PB version 4.30 and below
  • increase max sprites per layer = 5000 (can be customized)
  • optimized layer rendering : all layers share the same memory buffer
  • first easing results
(example with 16 easing modes)
Image
Last edited by eddy on Mon Sep 28, 2009 3:40 am, edited 1 time in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

v0.93 uploaded
- easing FX : EasingMove, EasingRotate, EasingScale
- added 31 easing modes

Code: Select all

   #EASE_Linear=0
   #EASE_Min_In
   #EASE_Min_Out
   #EASE_Min_InOut
   #EASE_Light_In
   #EASE_Light_Out
   #EASE_Light_InOut
   #EASE_Medium_In
   #EASE_Medium_Out
   #EASE_Medium_InOut
   #EASE_Heavy_In
   #EASE_Heavy_Out
   #EASE_Heavy_InOut
   #EASE_Max_In
   #EASE_Max_Out
   #EASE_Max_InOut
   
   #EASE_Sine_In
   #EASE_Sine_Out
   #EASE_Sine_InOut
   #EASE_Circular_In
   #EASE_Circular_Out
   #EASE_Circular_InOut
   #EASE_Back_In
   #EASE_Back_Out
   #EASE_Back_InOut
   #EASE_Bounce_In
   #EASE_Bounce_Out
   #EASE_Bounce_InOut
   #EASE_Elastic_In
   #EASE_Elastic_Out
   #EASE_Elastic_InOut
[/size]
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Sprite3D engine with FX [cross-platform]

Post by jamirokwai »

Dear Eddy,

I tried the new 0.93 on Mac OS PB x86 4.31 and x86 4.40b3 but there is an error regarding a structure .a

;transition settings
Structure GS_TRANSITION_COLOR
defined.b
r.a <-- this one
g.a
b.a
dr.f
dg.f
db.f
EndStructure

I suppose it's a PB-error? Maybe the .a-variable is missing at the moment.

Edit: I forgot to add: it's line 506 in gearsprite.pb
Regards,
JamiroKwai
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

jamirokwai wrote:Dear Eddy,

I tried the new 0.93 on Mac OS PB x86 4.31 and x86 4.40b3 but there is an error regarding a structure .a
.a (ascii) have been introduced in version 4.40b1 ( http://www.purebasic.fr/english/viewtop ... 524#295524 )

You can compile this code with PB 4.40b3. If not, you can report this problem as a bug.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

If you want to test this version, you can replace all ".a" by ".i"
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: Sprite3D engine with FX [cross-platform]

Post by jamirokwai »

eddy wrote:If you want to test this version, you can replace all ".a" by ".i"
Oh Gawd. I was too sleepy this morning. Mac x86 PB4.40b3 supports .a. Works great now that I realized my fault... Sorry for this!
Regards,
JamiroKwai
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

I'll try to integrate the polygon collision : http://www.purebasic.fr/english/viewtop ... =collision
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Sprite3D engine with FX [cross-platform]

Post by eddy »

:arrow: http://www.datafilehost.com/download-a1f2edf8.html

v0.94 uploaded
- FX : attachObjectFX (special FX for attached sprites)
- group sprite functions : AttachSpriteChild, DetachSpriteChild, CountSpriteChilds

I code these functions for future Text sprites.
I've not enough time to do more. :roll:


Todo:
- text sprites
- text FXs
- bitmap font generator
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: Sprite3D engine with FX [cross-platform]

Post by dige »

Well done!
Post Reply