Hello there.
I'm working on a 3D engine for a space dog-fighting game is AS3. It's in its very early stages and I'm in the process of adding a central star which I'll position planets around. Up until now I've been drawing the star as a circle - its size dependent on the player's distance. But I want to put a glow filter on the star, so I need to draw the circle inside a movie clip.
Problem is, as soon as I do that the circle gets drawn in bizarre places. I've traced the coordinates where it SHOULD be drawn and they are correct. I've even added back in the code to draw the circle straight to the screen so that I can see both where it SHOULD be and where the centralStar movieClip is drawing it.
Here is the draw function in my Sun class. The parameters passed to it are your ship's facing (as a Vector3D), your ship's x,y,z coordinates (a Vector3D) and the matrix3D of your ship's rotation.
'distanceTo' is your ship's direct distance from the central star and 'rad' is the radius of the central star.
Is there any reason the drawCircle line would draw the circle in weird places? Is there something I'm not getting about drawing inside MovieClips?
I'll try and attach the current version. The yellow star with the glow is the errant star. The red one is the non-MovieClip version getting drawn where the yellow one SHOULD be.
If you want to move around in the space for the moment you'll have to click your mouse then roll the mouse wheel up to power up your thrust. Space is move forward, shift is move back, A,W,D and S are strafe - in their respective directions.
If anyone has any clue, please let me know!
Cheers.
Sorry, but please explain what you are trying to do in much more detail. I don't know what inverseCoordinates actually is--a movieclip or a variable? Once you have done so I'll take a look and see what could be wrong.