Sign up ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

This is likely a stupid error but I can't seem to find what I've done wrong.

I've got a simple scene with 10 cylinders rotating at a default speed.

If I grab one of these cylinders I can rotate it in the opposite direction or at a greater speed.

I have a single directional light in the scene.

It would appear that the directional light is only calculated at initialization and not on further frames. The shadow created by the light rotates with the cylinder giving the impression that the light is rotating when it isn't.

Camera & Light Initialization

_view = new View3D();

_view.antiAlias = 4;
_view.backgroundColor = 0xFFFFFF; = -850; = 0; = 0; Vector3D()); = new PerspectiveLens(15);
_view.mousePicker = PickingType.RAYCAST_BEST_HIT;

_light = new DirectionalLight();
_light.z = -850;
_light.direction = new Vector3D(1, 1, 1);
_light.color = 0xFFFFFF;
_light.ambient = 0.1;
_light.diffuse = 0.7;

Mesh and Material creation

var material:TextureMaterial = new TextureMaterial(createPow2Texture(sprite, _colors[i]) , true, false, true);
material.animateUVs = true;
material.lightPicker = _lightPicker;

cylinder = new Mesh(new CylinderGeometry(radius, radius, 13, 70, 1, true, true), material);
cylinder.subMeshes[0].scaleU = spriteWidth / sprite.width;
cylinder.y = y;
cylinder.mouseEnabled = true;
cylinder.pickingCollider = PickingColliderType.AS3_BEST_HIT;
cylinder.addEventListener(MouseEvent3D.MOUSE_OVER, onMouseOverMesh);
cylinder.addEventListener(MouseEvent3D.MOUSE_MOVE, onMouseOverMesh);
cylinder.addEventListener(MouseEvent3D.MOUSE_OUT, onMouseOutMesh);


private function onEnterFrame(event:Event):void
    for each (var mesh:Mesh in _cylinders)
        if (mesh == _mouseOverMesh)

        mesh.rotationY += 0.25;
share|improve this question

closed as off-topic by Josh Petrie Dec 22 '14 at 19:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about debugging a problem in your project must present a concise selection of code and context so as to allow a reader to diagnose the issue without needing to read all of your code or to engage in extensive back-and-forth dialog. For more information, see this meta thread." – Josh Petrie
If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.