Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: Expressions and Jetflares

  1. #1
    Registered User SonicN2O's Avatar
    Join Date
    Aug 2010
    Location
    Chicago
    Posts
    485

    Expressions and Jetflares

    To quote "Essential lightwave v9", page 895 paragraph 1:
    "For instance, taking the movement of a spacecraft and relating it to the intensity of the engine glare..."
    I want to do just that. Problem is I have absolutely no idea how; I'm pretty bad at expressions.
    "'Sup, Djents?"

    iMac Quad Core i7
    24GB RAM 1600MHz
    GeForce GTX680MX 2GB

  2. #2
    Registered User borkus's Avatar
    Join Date
    Aug 2006
    Location
    augusta, me
    Posts
    675
    I wish I could help you. I have researched this a bit, but feel this link will help you more then I can in volumes... Lightwave Expressions
    Last edited by borkus; 05-09-2011 at 10:35 PM.

  3. #3
    Newbie Member falogfx's Avatar
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    55
    I haven't got Lightwave available, but you could possibly make an expression something like this:

    sqrt( ([Ship.Position.X, Frame] - [Ship.Position.X, Frame - 1]) * ([Ship.Position.X, Frame] - [Ship.Position.X, Frame - 1]) + ([Ship.Position.Y, Frame] - [Ship.Position.Y, Frame - 1]) * ([Ship.Position.Y, Frame] - [Ship.Position.Y, Frame - 1]) + ([Ship.Position.Z, Frame] - [Ship.Position.Z, Frame - 1]) * ([Ship.Position.Z, Frame] - [Ship.Position.Z, Frame - 1]) ) * 2 + 0.3

    Where Ship is the name of your spacecraft object. Change it to the correct name.

    The long sqrt expression gives the current speed of Ship (between current and last frame).

    The number "2" is the factor that the speed is multplied with. Adjust to your liking. This value should probaly be much lower for a fast moving object, like 0.001.

    The number "0.3" is the initial intensity of the glare when speed is zero.

    Create the expression in graph editor and attach it to your intensity channel.

    I hope I have done the math correctly, that it works and that I've made no typos.

  4. #4
    Super Member DBMiller's Avatar
    Join Date
    May 2003
    Location
    Vermont
    Posts
    1,142
    Quote Originally Posted by borkus View Post
    I wish I could help you. I have researched this a bit, but feel this link will help you more then I can in volumes... Lightwave Expressions
    If this is the best answer you care to give someone asking for help then why bother?
    Mac OS 10.10.5 Yosemite, 2.66 GHz Core 2 duo, 4 GB RAM,ATI Radeon HD 2600 Pro

  5. #5
    Banned OnlineRender's Avatar
    Join Date
    Dec 2008
    Location
    Glasgow , Scotland , UK
    Posts
    6,383
    yeah but now you need to teach Sonic excatly where and how to put it , so if you don't mind we need 8 video tutorials with colour coordinated pdfs
    Last edited by OnlineRender; 05-10-2011 at 08:53 AM.

  6. #6
    Man of many cells. shrox's Avatar
    Join Date
    Aug 2006
    Location
    Eureka, CA
    Posts
    7,099
    For light lens flares, copy the envelope of the FOV or camera zoom, then paste that into the global lens flare graph. Use the scale tool, set the cursor at 0%, then scale the values until the first key is at 100%. It's hack, and kind of loses it at extreme zooms, but it works well enough.
    Last edited by shrox; 05-10-2011 at 04:00 PM.
    shrox www.shrox.com
    -----------------------
    Heavy Metal Landing


    -----------------------
    I build the best spaceships, the biggest spaceships, they're great, you'll love them.

  7. #7
    Registered User SonicN2O's Avatar
    Join Date
    Aug 2010
    Location
    Chicago
    Posts
    485
    Quote Originally Posted by DBMiller View Post
    If this is the best answer you care to give someone asking for help then why bother?
    Actually, posting a link to a good tutorial IS a way to give someone help. thanks Borkus

    OnlineRender, keep your comments to yourself.
    "'Sup, Djents?"

    iMac Quad Core i7
    24GB RAM 1600MHz
    GeForce GTX680MX 2GB

  8. #8
    Banned OnlineRender's Avatar
    Join Date
    Dec 2008
    Location
    Glasgow , Scotland , UK
    Posts
    6,383
    Quote Originally Posted by SonicN2O View Post
    Actually, posting a link to a good tutorial IS a way to give someone help. thanks Borkus

    OnlineRender, keep your comments to yourself.
    No comment,well maybe just one ............. you joking me the user falogfx just wrote you a wicked expression for FREE ....................I suggest you use it to your advantage and as for tutorials http://tinyurl.com/5t9gcpq

  9. #9
    Registered User SonicN2O's Avatar
    Join Date
    Aug 2010
    Location
    Chicago
    Posts
    485
    OK. Thank you. I just don't like it when you tease me.
    "'Sup, Djents?"

    iMac Quad Core i7
    24GB RAM 1600MHz
    GeForce GTX680MX 2GB

  10. #10
    Registered User SonicN2O's Avatar
    Join Date
    Aug 2010
    Location
    Chicago
    Posts
    485
    The Expression works like a dream!
    "'Sup, Djents?"

    iMac Quad Core i7
    24GB RAM 1600MHz
    GeForce GTX680MX 2GB

  11. #11
    Newbie Member falogfx's Avatar
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    55
    Quote Originally Posted by SonicN2O View Post
    The Expression works like a dream!
    Glad to hear that! I still haven't tested it myself

  12. #12
    Registered User SonicN2O's Avatar
    Join Date
    Aug 2010
    Location
    Chicago
    Posts
    485
    Quote Originally Posted by borkus View Post
    I wish I could help you. I have researched this a bit, but feel this link will help you more then I can in volumes... Lightwave Expressions
    WAIT... That was lmgtfy? you know that's rude, right?
    "'Sup, Djents?"

    iMac Quad Core i7
    24GB RAM 1600MHz
    GeForce GTX680MX 2GB

  13. #13
    Registered User SonicN2O's Avatar
    Join Date
    Aug 2010
    Location
    Chicago
    Posts
    485
    For that expression I'm using... Is there a way to make it so that the intensity doesn't go below zero? Also I have these thrusters that turn the ship sideways. I there a way to make an expression that plays the bank axis? sorry... I don't know much about expressions...
    "'Sup, Djents?"

    iMac Quad Core i7
    24GB RAM 1600MHz
    GeForce GTX680MX 2GB

  14. #14
    Registered User SonicN2O's Avatar
    Join Date
    Aug 2010
    Location
    Chicago
    Posts
    485
    Quote Originally Posted by OnlineRender View Post
    No comment,well maybe just one ............. you joking me the user falogfx just wrote you a wicked expression for FREE ....................I suggest you use it to your advantage and as for tutorials http://tinyurl.com/5t9gcpq
    lmgtfy.com... right... THANKS, but i think I know how to use google.
    "'Sup, Djents?"

    iMac Quad Core i7
    24GB RAM 1600MHz
    GeForce GTX680MX 2GB

  15. #15
    Newbie Member falogfx's Avatar
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    55
    Quote Originally Posted by SonicN2O View Post
    For that expression I'm using... Is there a way to make it so that the intensity doesn't go below zero? Also I have these thrusters that turn the ship sideways. I there a way to make an expression that plays the bank axis? sorry... I don't know much about expressions...
    I suppose you're talking about the expression I wrote for you earlier in this thread.
    Because of how the ship's speed is calculated, the output value of that expression can not be below zero. That is, as long as you are using positive numbers for initial intensity and the multiplier. So I don't know why you are getting negative values.

    Yes, you can make an expression that takes the bank axis as input. You will need two different expressions, one for each side.

    You could write them something like this. Example for one side, try to figure the other side out yourself.

    Name: TurnLeft
    Expression:
    ( ([Ship.Rotation.B, Time]-[Ship.Rotation.B, Time - 0.1]) > 0 ? abs([Ship.Rotation.B, Time]-[Ship.Rotation.B, Time - 0.1])/360 * 2 : 0 ) + 0.3

    How it works:
    Let's simplify the expression to a more readable form...
    ( BankDifference > 0 ? abs(BankDifference) / 360 * 2 : 0 ) + 0.3

    Gets difference (or speed) in bank rotation and checks if it is greater than zero. If it is, then we know that we are turning left and the absolute value of the difference is calulated, divided by 360 (degrees) and multiplied by 2 (or whatever value fits the desired intensity)

    If the difference in rotation is zero or negative, set to 0 (../360 * 2 : 0).

    0.3 is then added to the result to set the initial intensity. This can of course be another non negative value that suits your needs.

    You could also try to use other time spans in the expressions to get delay effects. For example:
    ([Ship.Rotation.B, Time + 1]-[Ship.Rotation.B, Time + 0.9]) will make the thrusters start burning one second before the ship begins to turn, and also stop to burn one second before the ship stops turning.

    Expressions are quite fun

    Good luck!
    Last edited by falogfx; 05-23-2011 at 05:07 AM. Reason: Fixed typos

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •