Alright, here we go: :) ShoulderCam.as:
The public 'unsteady' Object has properties that are tweened by
TweenMax:
package
{
import com.greensock.TweenMax;
import com.greensock.easing.Sine;
/**
* ...
* @author 0L4F
*/
public class ShoulderCam
{
private const maxRotationY:int = 2;
private const maxRotationX:int = 1;
private const maxRotationZ:int = 1;
public var unsteady:Object;
public function ShoulderCam()
{
unsteady = new Object();
unsteady.rY = 0;
unsteady.rX = 0;
unsteady.rZ = 0;
tweenCamRotationY();
tweenCamRotationX();
tweenCamRotationZ();
}
private function tweenCamRotationY():void
{
var randomRotationY:Number = -maxRotationY +
(Math.random() * maxRotationY * 2);
TweenMax.to(unsteady, 0.2 + Math.random() * 3,
{ rY:randomRotationY, ease:Sine.easeInOut,
onComplete:tweenCamRotationY } );
}
private function tweenCamRotationX():void
{
var randomRotationX:Number = -maxRotationX +
(Math.random() * maxRotationX * 2);
TweenMax.to(unsteady, 0.2 + Math.random() * 3,
{ rX:randomRotationX, ease:Sine.easeInOut,
onComplete:tweenCamRotationX } );
}
private function tweenCamRotationZ():void
{
var randomRotationZ:Number = -maxRotationZ +
(Math.random() * maxRotationZ * 2);
TweenMax.to(unsteady, 0.2 + Math.random() * 3,
{ rZ:randomRotationZ, ease:Sine.easeInOut,
onComplete:tweenCamRotationZ } );
}
}
}
On Apr 6, 7:07 pm, Josh Beckwith <[email protected]> wrote:
> Although I don't have a use for it, I am curious. I like seeing how
> other people code!
>
> You don't have to post the whole project or anything, just a copy/
> paste of the shoulder cam class would do.
>
> Thanks!
>
> On Apr 5, 10:59 am, RocketClowns <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi Josh, thanks for the compliment :) !
>
> > I wrote a simple 'ShoulderCam' class that subtly and randomly tweens
> > the camera rotationX, Y and Z with TweenMax, on top of the user mouse
> > input...
>
> > If you're interested, I'd be happy to share the code :)
>
> > On Apr 5, 6:18 pm, Josh Beckwith <[email protected]> wrote:> Looks
> > good RocketClowns! How'd you go about doing the camera wobble?
> > > It's a nice effect!
>
> > > On Apr 4, 12:52 pm, RocketClowns <[email protected]> wrote:
>
> > > > Look here: a 2048 .jpg Skybox, with a 1024 .jpg EnvMap:
>
> > > >http://www.0l4f.com/molehill/away5/
>
> > > > (takes a while to load, .swf is 6.5 MB)
>
> > > > On Apr 4, 9:42 pm, RocketClowns <[email protected]> wrote:> I'm
> > > > using 2048 .jpg textures on Skybox Cubemaps without problems.
>
> > > > > Can't use those as EnvMaps though (render fails).
>
> > > > > On Apr 4, 9:29 pm, Darcey Lloyd <[email protected]> wrote:
>
> > > > > > I tried a 2048 on a cubemap and it failed but worked for 1024.
>
> > > > > > On 4 April 2011 20:11, Sintesis <[email protected]> wrote:
>
> > > > > > > Ok, thank you