1. ## 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.

2. 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

3. 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. Originally Posted by borkus
If this is the best answer you care to give someone asking for help then why bother?

5. 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

6. 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.

7. Originally Posted by DBMiller
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

8. Originally Posted by SonicN2O
Actually, posting a link to a good tutorial IS a way to give someone help. thanks Borkus

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. OK. Thank you. I just don't like it when you tease me.

10. The Expression works like a dream!

11. Originally Posted by SonicN2O
The Expression works like a dream!
Glad to hear that! I still haven't tested it myself

12. Originally Posted by borkus
WAIT... That was lmgtfy? you know that's rude, right?

13. 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...

14. Originally Posted by OnlineRender
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.

15. Originally Posted by SonicN2O
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!

#### Posting Permissions

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