It is currently Mon Nov 19, 2018 12:27 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Pres3D source
PostPosted: Sun Oct 17, 2010 6:03 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Feb 09, 2006 11:27 pm
Posts: 2337
Hi,
thought do have a look into the source to play around a little bit, but the effects.pbi seems to be absent, where can I get it?

Thanks,
Michael


Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Sun Oct 17, 2010 6:07 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Aug 11, 2009 1:56 pm
Posts: 860
Location: Essen (Germany)
effects.pbi :
Code:
#SpeedFactor  = 3 ; usually 1 to 5. Default = 3.

; -------------------------------------------------------------------------------------------
; INITS
; -------------------------------------------------------------------------------------------

; initialize the ingoing effect for the InObjects(CurrObject.l)
Procedure.l EffectInitIn(*Effect.structEffectParameters, ScreenWidth.l, ScreenHeight.l, CurrObject.l, GroupID.l, GroupMax.l)
  ; GroupID: which number of a group with GroupMax members am I?
  ; In case of no group (images?) set 1 and 1.
  With InObjects(CurrObject.l)
   
  *Effect\Direction = UCase(*Effect\Direction)
  *Effect\Rotation  = UCase(*Effect\Rotation)
   
  Select LCase(*Effect\Type)
     
    Case "standard" ; standard fade in effect
      \ActualTransparency = 0
      \Transform = #True
      ; movement
      If FindString(*Effect\Direction, "L", 1) > 0: \ActualPosX = \PosX - ScreenWidth.l : EndIf
      If FindString(*Effect\Direction, "R", 1) > 0: \ActualPosX = \PosX + ScreenWidth.l : EndIf
      If FindString(*Effect\Direction, "T", 1) > 0: \ActualPosY = \PosY - ScreenHeight.l : EndIf
      If FindString(*Effect\Direction, "B", 1) > 0: \ActualPosY = \PosY + ScreenHeight.l : EndIf
      If FindString(*Effect\Direction, "F", 1) > 0: \ActualPosZ = #InitialZ * 4: EndIf
      If FindString(*Effect\Direction, "V", 1) > 0: \ActualPosZ = 0: EndIf
      \Val0 = (\PosX - \ActualPosX) / (255 / #SpeedFactor) ; vector X
      \Val1 = (\PosY - \ActualPosY) / (255 / #SpeedFactor) ; vector Y
      \Val2 = (\PosZ - \ActualPosZ) / (255 / #SpeedFactor) ; vector Z
      ; rotation
      If FindString(*Effect\Rotation, "X", 1) > 0: \ActualAngleX = 8: EndIf
      If FindString(*Effect\Rotation, "Y", 1) > 0: \ActualAngleY = 8: EndIf
      If FindString(*Effect\Rotation, "Z", 1) > 0: \ActualAngleZ = 8: EndIf
      If FindString(*Effect\Rotation, "L", 1) > 0
        ; rotate left (counterclockwise)
        \ActualAngleX = - \ActualAngleX
        \ActualAngleY = - \ActualAngleY
        \ActualAngleZ = - \ActualAngleZ
      EndIf
      \Val3 = (\AngleX - \ActualAngleX) / (255 / #SpeedFactor)
      \Val4 = (\AngleY - \ActualAngleY) / (255 / #SpeedFactor)
      \Val5 = (\AngleZ - \ActualAngleZ) / (255 / #SpeedFactor)
      ; delayed mode
      If FindString(*Effect\Misc, "D", 1) > 0: \Delay = \Delay + ((GroupID.l - 1) * 40): EndIf
      ProcedureReturn
     
    Case "explode"
      \ActualTransparency = 0
      \Transform = #True
      ; movement
      \ActualPosX = \PosX + Random(ScreenWidth.l / 3) - ScreenWidth.l / 6
      \ActualPosY = \PosY + Random(ScreenWidth.l / 3) - ScreenWidth.l / 6
      \ActualPosZ = \PosZ + Random(ScreenWidth.l / 1) - ScreenWidth.l / 2
      If FindString(*Effect\Direction, "L", 1) > 0: \ActualPosX = \ActualPosX - ScreenWidth.l / 2: EndIf
      If FindString(*Effect\Direction, "R", 1) > 0: \ActualPosX = \ActualPosX + ScreenWidth.l / 2: EndIf
      If FindString(*Effect\Direction, "T", 1) > 0: \ActualPosY = \ActualPosY - ScreenHeight.l / 2: EndIf
      If FindString(*Effect\Direction, "B", 1) > 0: \ActualPosY = \ActualPosY + ScreenHeight.l / 2: EndIf
      \Val0 = (\PosX - \ActualPosX) / (255 / #SpeedFactor) ; vector X
      \Val1 = (\PosY - \ActualPosY) / (255 / #SpeedFactor) ; vector Y
      \Val2 = (\PosZ - \ActualPosZ) / (255 / #SpeedFactor) ; vector Z
      ; rotation
      \ActualAngleX = Random(3141) / 1000
      \ActualAngleY = Random(3141) / 1000
      \ActualAngleZ = Random(3141) / 1000
      \Val3 = (\AngleX - \ActualAngleX) / (255 / #SpeedFactor)
      \Val4 = (\AngleY - \ActualAngleY) / (255 / #SpeedFactor)
      \Val5 = (\AngleZ - \ActualAngleZ) / (255 / #SpeedFactor)
      ; delayed mode
      If FindString(*Effect\Misc, "D", 1) > 0: \Delay = \Delay + ((GroupID.l - 1) * 30): EndIf
     
    Case "turn"
      \ActualTransparency = 0
      \Transform = #True
      ; movement
      \ActualPosZ = \ActualPosZ + 400
      If FindString(*Effect\Direction, "L", 1) > 0: \ActualPosX = \ActualPosX - 300: EndIf
      If FindString(*Effect\Direction, "R", 1) > 0: \ActualPosX = \ActualPosX + 300: EndIf
      If FindString(*Effect\Direction, "T", 1) > 0: \ActualPosY = \ActualPosY - 200: EndIf
      If FindString(*Effect\Direction, "B", 1) > 0: \ActualPosY = \ActualPosY + 200: EndIf
      \Val0 = (\PosX - \ActualPosX) / (255 / #SpeedFactor) ; vector X
      \Val1 = (\PosY - \ActualPosY) / (255 / #SpeedFactor) ; vector Y
      \Val2 = (\PosZ - \ActualPosZ) / (255 / #SpeedFactor) ; vector Z
      ; rotation
      If FindString(*Effect\Direction, "L", 1) > 0: \ActualAngleY = \ActualAngleY - #PI * 0.4: EndIf
      If FindString(*Effect\Direction, "R", 1) > 0: \ActualAngleY = \ActualAngleY + #PI * 0.4: EndIf
      If FindString(*Effect\Direction, "T", 1) > 0: \ActualAngleX = \ActualAngleX + #PI * 0.4: EndIf
      If FindString(*Effect\Direction, "B", 1) > 0: \ActualAngleX = \ActualAngleX - #PI * 0.4: EndIf
      \Val3 = (\AngleX - \ActualAngleX) / (255 / #SpeedFactor)
      \Val4 = (\AngleY - \ActualAngleY) / (255 / #SpeedFactor)
      \Val5 = (\AngleZ - \ActualAngleZ) / (255 / #SpeedFactor)
      ; delayed mode
      If FindString(*Effect\Misc, "D", 1) > 0: \Delay = \Delay + ((GroupID.l - 1) * 30): EndIf
     
    Case "wave"
      \ActualTransparency = 0
      \Transform = #True
      ; movement
      \Val1 = (255 / #SpeedFactor)
      ; delayed mode
      If FindString(*Effect\Misc, "D", 1) > 0: \Delay = \Delay + ((GroupID.l - 1) * 30): EndIf
  EndSelect
 
  EndWith
     
EndProcedure

; initialize the outgoing effect for the OutObjects(CurrObject.l)
Procedure.l EffectInitOut(*Effect.structEffectParameters, ScreenWidth.l, ScreenHeight.l, CurrObject.l, GroupID.l, GroupMax.l)
  ; GroupID: which number of a group with GroupMax members am I?
  ; In case of no group (images?) set 1 and 1.
  With OutObjects(CurrObject.l)
   
  Select LCase(*Effect\Type)
   
    Case "standard" ; standard fade out effect
      \ActualTransparency = 255
      \Transform = #True
      \Delay = 0
      ; movement
      If FindString(*Effect\Direction, "L", 1) > 0: \PosX = \PosX - ScreenWidth.l : EndIf
      If FindString(*Effect\Direction, "R", 1) > 0: \PosX = \PosX + ScreenWidth.l : EndIf
      If FindString(*Effect\Direction, "T", 1) > 0: \PosY = \PosY - ScreenHeight.l : EndIf
      If FindString(*Effect\Direction, "B", 1) > 0: \PosY = \PosY + ScreenHeight.l : EndIf
      If FindString(*Effect\Direction, "F", 1) > 0: \PosZ = #InitialZ * 4: EndIf
      If FindString(*Effect\Direction, "V", 1) > 0: \PosZ = -100: EndIf
      \Val0 = (\PosX - \ActualPosX) / (255 / #SpeedFactor) ; vector X
      \Val1 = (\PosY - \ActualPosY) / (255 / #SpeedFactor) ; vector Y
      \Val2 = (\PosZ - \ActualPosZ) / (255 / #SpeedFactor) ; vector Z
      ; rotation
      If FindString(*Effect\Rotation, "X", 1) > 0: \AngleX = -8: EndIf
      If FindString(*Effect\Rotation, "Y", 1) > 0: \AngleY = -8: EndIf
      If FindString(*Effect\Rotation, "Z", 1) > 0: \AngleZ = -8: EndIf
      If FindString(*Effect\Rotation, "L", 1) > 0
        ; rotate left (counterclockwise)
        \AngleX = - \AngleX
        \AngleY = - \AngleY
        \AngleZ = - \AngleZ
      EndIf
      \Val3 = (\AngleX - \ActualAngleX) / (255 / #SpeedFactor)
      \Val4 = (\AngleY - \ActualAngleY) / (255 / #SpeedFactor)
      \Val5 = (\AngleZ - \ActualAngleZ) / (255 / #SpeedFactor)
      ; delayed mode
      If FindString(*Effect\Misc, "D", 1) > 0: \Delay = \Delay + ((GroupID.l - 1) * 40): EndIf
      ProcedureReturn
     
    Case "explode"
      \ActualTransparency = 255
      \Transform = #True
      \Delay = 0
      ; movement
      \Val0 = (Random(400) - 200) / (255 / #SpeedFactor) ; vector X
      \Val1 = (Random(400) - 200) / (255 / #SpeedFactor) ; vector Y
      \Val2 = (Random(800) - 400) / (255 / #SpeedFactor) ; vector Z
      If FindString(*Effect\Direction, "L", 1) > 0: \Val0 = \Val0 - #SpeedFactor*2: EndIf
      If FindString(*Effect\Direction, "R", 1) > 0: \Val0 = \Val0 + #SpeedFactor*2: EndIf
      If FindString(*Effect\Direction, "T", 1) > 0: \Val1 = \Val1 - #SpeedFactor*2: EndIf
      If FindString(*Effect\Direction, "B", 1) > 0: \Val1 = \Val1 + #SpeedFactor*2: EndIf
      ; rotation
      \Val3 = (Random(400) - 200) / 4000 ; rot X
      \Val4 = (Random(400) - 200) / 4000 ; rot Y
      \Val5 = (Random(400) - 200) / 4000 ; rot Z
      ; delayed mode
      If FindString(*Effect\Misc, "D", 1) > 0: \Delay = \Delay + ((GroupID.l - 1) * 30): EndIf
      ProcedureReturn
     
    Case "turn"
      \ActualTransparency = 255
      \Transform = #True
      \Delay = 0
      ; movement
      \PosZ = \PosZ + 400
      If FindString(*Effect\Direction, "L", 1) > 0: \PosX = \PosX - 200: EndIf
      If FindString(*Effect\Direction, "R", 1) > 0: \PosX = \PosX + 200: EndIf
      If FindString(*Effect\Direction, "T", 1) > 0: \PosY = \PosY - 200: EndIf
      If FindString(*Effect\Direction, "B", 1) > 0: \PosY = \PosY + 200: EndIf
      \Val0 = (\PosX - \ActualPosX) / (255 / #SpeedFactor) ; vector X
      \Val1 = (\PosY - \ActualPosY) / (255 / #SpeedFactor) ; vector Y
      \Val2 = (\PosZ - \ActualPosZ) / (255 / #SpeedFactor) ; vector Z
      ; rotation
      If FindString(*Effect\Direction, "L", 1) > 0: \AngleY = \AngleY - #PI * 0.4: EndIf
      If FindString(*Effect\Direction, "R", 1) > 0: \AngleY = \AngleY + #PI * 0.4: EndIf
      If FindString(*Effect\Direction, "T", 1) > 0: \AngleX = \AngleX + #PI * 0.4: EndIf
      If FindString(*Effect\Direction, "B", 1) > 0: \AngleX = \AngleX - #PI * 0.4: EndIf
      \Val3 = (\AngleX - \ActualAngleX) / (255 / #SpeedFactor)
      \Val4 = (\AngleY - \ActualAngleY) / (255 / #SpeedFactor)
      \Val5 = (\AngleZ - \ActualAngleZ) / (255 / #SpeedFactor)
      ; delayed mode
      If FindString(*Effect\Misc, "D", 1) > 0: \Delay = \Delay + ((GroupID.l - 1) * 30): EndIf
      ProcedureReturn
     
    Case "wave"
      \ActualTransparency = 255
      \Transform = #True
      \Delay = 0
      ; movement
      \Val1 = 0
      ; delayed mode
      If FindString(*Effect\Misc, "D", 1) > 0: \Delay = \Delay + ((GroupID.l - 1) * 30): EndIf
      ProcedureReturn
     
  EndSelect
 
  EndWith
     
EndProcedure

; -------------------------------------------------------------------------------------------
; TRANSFORMS
; -------------------------------------------------------------------------------------------

; do the ingoing effect for the InObjects(CurrObject.l)
Procedure EffectTransformIn(*Effect.structEffectParameters, ScreenWidth.l, ScreenHeight.l, CurrObject.l, MaxObjects.l)
 
  With InObjects(CurrObject.l)
 
  Select LCase(*Effect\Type)
    Case "standard", "explode", "turn" ; standard movement calculation
      \ActualTransparency = \ActualTransparency + #SpeedFactor
     
      \ActualPosX = \ActualPosX + \Val0
      \ActualPosY = \ActualPosY + \Val1
      \ActualPosZ = \ActualPosZ + \Val2
      \ActualAngleX = \ActualAngleX + \Val3
      \ActualAngleY = \ActualAngleY + \Val4
      \ActualAngleZ = \ActualAngleZ + \Val5
     
      If \ActualTransparency >= 255
        \ActualTransparency = 255
        \Transform = #False ; ready
      EndIf
     
      ProcedureReturn
     
    Case "wave" ; wave movement calculation
      \ActualTransparency = \ActualTransparency + #SpeedFactor
      \Val0 = \Val0 + 0.1
      \Val1 = \Val1 - 1
      If FindString(\EffectIn\Direction, "X", 1) > 0: \ActualPosX = \PosX + Sin(\Val0) * \Val1: EndIf
      If FindString(\EffectIn\Direction, "Y", 1) > 0: \ActualPosY = \PosY + Sin(\Val0) * \Val1: EndIf
      If FindString(\EffectIn\Direction, "Z", 1) > 0: \ActualPosZ = \PosZ + Sin(\Val0) * \Val1: EndIf
     
      If \ActualTransparency >= 255
        \ActualTransparency = 255
        \Transform = #False ; ready
      EndIf
      ProcedureReturn

  EndSelect

  EndWith
EndProcedure

; do the outgoing effect for the InObjects(CurrObject.l)
Procedure EffectTransformOut(*Effect.structEffectParameters, ScreenWidth.l, ScreenHeight.l, CurrObject.l, MaxObjects.l)
 
  With OutObjects(CurrObject.l)
   
  Select LCase(*Effect\Type)
    Case "standard", "explode", "turn" ; standard movement calcumaltion
      \ActualTransparency = \ActualTransparency - #SpeedFactor
     
      \ActualPosX = \ActualPosX + \Val0
      \ActualPosY = \ActualPosY + \Val1
      \ActualPosZ = \ActualPosZ + \Val2
      \ActualAngleX = \ActualAngleX + \Val3
      \ActualAngleY = \ActualAngleY + \Val4
      \ActualAngleZ = \ActualAngleZ + \Val5
     
      If \ActualTransparency < 1
        \ActualTransparency = 0
        \Transform = #False ; ready
      EndIf
      ProcedureReturn
     
    Case "wave" ; wave movement calculation
      \ActualTransparency = \ActualTransparency - #SpeedFactor
     
      \Val0 = \Val0 + 0.1
      \Val1 = \Val1 + 1
      If FindString(\EffectOut\Direction, "X", 1) > 0: \ActualPosX = \PosX + Sin(\Val0) * \Val1: EndIf
      If FindString(\EffectOut\Direction, "Y", 1) > 0: \ActualPosY = \PosY + Sin(\Val0) * \Val1: EndIf
      If FindString(\EffectOut\Direction, "Z", 1) > 0: \ActualPosZ = \PosZ + Sin(\Val0) * \Val1: EndIf
     
      If \ActualTransparency < 1
        \ActualTransparency = 0
        \Transform = #False ; ready
      EndIf
      ProcedureReturn

  EndSelect

  EndWith

EndProcedure

I'll remove it when the main source download is updated again

_________________
Two growing code-collections: WinApi-Lib by RSBasic ~ LinuxAPI-Lib by Omi

Missing a download-file on the forums? ~ check out this backup page.


Last edited by Vera on Sun Oct 17, 2010 6:50 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Sun Oct 17, 2010 6:17 pm 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4019
Location: Germany
Hi Vera,

here it is:
http://www.infratec-ag.de/PureBASIC/Pres3D_V1.08.zip

I check now for valid video modes.
I switch now also to a new window size after opening an other xml.
I correced the bug that it was not possible to jump to the last page.

Bernd

EDIT: Puh... 23 minutes :!:
A new record to fix your reported bugs :mrgreen: :mrgreen: :mrgreen:


Last edited by infratec on Sun Oct 17, 2010 6:23 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Sun Oct 17, 2010 6:21 pm 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4019
Location: Germany
I only publish the files which I had modified.
So you have to download the original sourcecode from Kukulkan for the rest of the files.

Bernd


Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Sun Oct 17, 2010 7:09 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Feb 09, 2006 11:27 pm
Posts: 2337
Thanks,
perfect service (include is also missing in the original package) :wink:

Maybe not the right time for doing polishing the GUI, but when I started the program, I saw two things:
• the window gets overlapped here (Windows XP) by the windows task bar
• the "Goto page" does not accept the Enter key.

Here are the changes for the second point:

Code:
ButtonGadget(#GoGadget, 70, 10, 30, 20, "&Go",#PB_Button_Default)
SetActiveGadget(#PageGadget)
AddKeyboardShortcut(#GotoWindow,#PB_Shortcut_G|#PB_Shortcut_Alt,#GoGadget)
AddKeyboardShortcut(#GotoWindow,#PB_Shortcut_Return,#GoGadget)
:
Select Event
  Case #PB_Event_Gadget,#PB_Event_Menu


Hopefully a will have some time next week to do also some things here,
Michael


Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Mon Oct 18, 2010 7:31 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4019
Location: Germany
Hi,

I added a part of Michaels suggestions.
http://www.infratec-ag.de/PureBASIC/Pres3D_V1.09.zip

The goto value is now also accepted with the return key.
Personally I dont think that ALT+G makes sense.

The keyboard freaks (like me) using the number block and the return key (which is near by :mrgreen: ),
the mouse freaks try to find the button and click it :lol:

Bernd


Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Thu Aug 30, 2018 4:59 pm 
Offline
User
User

Joined: Sun Apr 11, 2010 11:01 am
Posts: 23
infratec: I know this is old by now, but I was just looking for some inspiration to text effects and tried downloading this. Seems the page is not active anymore. Would you happen to have this somewhere to share yet again?

Edit: While I'm at it. This is quite a brilliant piece of code. if anyone else hasn't already done it already, I will try myself (despite being a bit short on time and skill) to dumb this down for simplicity as well as use in more "dynamic" projects. It would really be a fantastic addition for developing presentations, games, info displays etc.

/Peter


Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Fri Aug 31, 2018 7:36 am 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 4019
Location: Germany
Hi,

sorry for the delay, but I had to convert it to PB 5.62 :wink:

Here is a link:

https://oc.ednt.de/index.php/s/X1mmGQep4xPv4GU

You should be able to create Pres3D.exe with it. Everything is included.

Bernd


Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Fri Aug 31, 2018 8:31 am 
Offline
User
User

Joined: Sun Apr 11, 2010 11:01 am
Posts: 23
infratec: You're the best. You probably also just saved me a couple of hours, approximately 3 keyboards and possibly a monitor (depending on frustration/rage if I'd have tried to do it myself).
Edit: Worked like a charm to compile. Just had to remember to switch to x86 due to the inline asm.

Kukulkan: And of course a huge thank your for you too for giving the original to the community!


Top
 Profile  
Reply with quote  
 Post subject: Re: Pres3D source
PostPosted: Thu Sep 13, 2018 6:38 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Dec 15, 2008 11:15 pm
Posts: 142
Location: Nashville, TN
Infratec,
Thank you for posting this. Funnily enough I was coming on the forum to look for this and BAM! there it was, even updated to 5.62. Saves me and others a TON of time, so once again, THANK YOU !!!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye