Im trying to figure out how to travel along a plane to a point in 3d space. It needs to feel as though travelling down a road. I have attached a swf with the desired effect. Im using the formula scale = fl/(fl + z);the problem im having is it looks fine until scale is > 1. I need the plane to stay central to the screen.
how to rotate a 2d plane in 3d? for example... i want to load a jpeg in to a movieclip, and then, using actionscript, flip the photo around so essenitally you're looking at the back of it.i've seen the Scripting 3D in Flash kirupa resource, but it's a bit advanced for what i need. i only want to flip a 2d plane 180 degrees.
I'm basically trying to emulate Photoshop's Vanishing Point tool where you can define the 4 2D points and the 3D plane is calculated from that information, in terms of the rotation of the plane relative to x y and z axes.
So if you have an image like this one: And you define the points of the four corners, maybe like this:
It would define the 3D plane that the surface must live on relative to the x y and z axes. Researching this has led me to some tutorials on drawTriangles and Homographies, but they all seem to be focused on mapping bitmap data and I can't seem to find anything that defines a 3D plane itself.
I have a 2d plane rotated on its x axis, with 2d display objects I want to move around on the plane. Its pretty similar to a chess board [URL]..
The board is a rotated rectangle, and the pieces are just 2d display objects. Whats the easiest way to manipulate those objects so they appear to be moving on the board?
I have an array of points and I need square planes to be drawn between these points and distorted if points change their coordinates (see what I mean in the attached file).So what is the best practice I should use to create such set of planes knowing just coordinates of the points (planes vertices)?
I am having trouble getting a spaceship to fly through space in 3 dimensions. I was wondering if anyone knows of like some good example source code for 3D plane flying movement?
Or if someone could point me in the right direction for the Trigonometry equations,
I add an FLVPlayback component on to a Papervision Plan. So far so good. Video plays, 3d works. But I am facing two issues:
1. Even though I set my MovieMaterial to interactive, I canot click on the controls. I have found someone else that stumbled onto something similar (link 1, link 2), but since they did not have answer, I though of asking here.
2. The FLVPlayback is jittery. What I mean is that the component's x position moves all the time from something like 0 to 10 or 20, then back to zero. Remember in the old days of analog television (if you're old enough) when you had to play with the tracking? It looks like that.
if I take a square, turn into a Movie Clip, addjust the Perspective Angle, and the Vanishing Points. Then I rotate the square along the x axis so that the square is now a plane laying on the z axis. How do I get the length of the Movie Clip? I need to know when a plane starts and ends on the z axis. I also need to get the width.
if I take a square, turn into a Movie Clip, addjust the Perspective Angle, and the Vanishing Points. Then I rotate the square along the x axis so that the square is now a plane laying on the z axis. How do I get the length of the Movie Clip? I need to know when a plane starts and ends on the z axis. I also need to get the width.
I have a wall of Planes at different angles and positions. I'd like to get the camera to rotate and look straight at the focused plane. I have created a dummy Plane (lookAtMe) that tweens to the Plane I click on as follows:
private function planeClicked(e:InteractiveScene3DEvent):void { lookAtTarget.copyTransform(this);
[Code]....
The camera centers on the looAtMe Plane but doesn't rotate so that the selected Plane is straight on.
I want to the badguy plane to hit the player's plane and take a subtraction from the player's heath. I've fiddled around with using "this" instead of the full path of the playerMC - no success. My hitTest is working fine for the bullets!
A longtime AS2 developer finally making the transition to AS3 and Papervision all in one big leap.Working from Lee Brimelow's awesome pv2 tutorial as a base I've been able to create a plane with a movieclip mapped to it. What I'd ideally like to do is limit the rotation of the plane to maximum of -45 to 45 degrees on the X and Y.[code]I've tried using basic conditionals to restrict p.rotationX and p.rotationY but they seem to be ignored.
don't know what trigger this on my Flash CS4, suddenly i cant see any object on my stage it just plane background and i can change its color, but when i start to draw i can see the initial drawing but when i release the mouse the object is gone, try to test the movie and the object is there. i try to close the program and open again but still the same until i discover that this behavior happen when my publish setting is set to action script 3.0 changing it to 2.0 and the problem goes away. i did not encounter this kind of behavior with as3 before.
I've searched around the web trying to find out how to set the primitive Plane backside material in papervision. Unfortunately without luck. That is why I'm turning to you,My question is simple (as written above):How do I set the background material of a Plane primitive in Papversion 2.0?
I'm trying to figure out how to rotate arrows on a 3D plane towards the mouse cursor using rotationY in Flash 10. Using the same technique as rotating towards the cursor on a 2D plane produces less than desirable results as you can see in the image below.
Code: root.transform.perspectiveProjection.projectionCenter = new Point(stage.stageWidth/2, 0); floor.rotationX = -90; // just a rectangle so we can see our plane arrow1.rotationX = -90; arrow2.rotationX = -90; arrow3.rotationX = -90; addEventListener(Event.ENTER_FRAME,pointToMouse); [Code] .....
The arrows seems to be focusing in on a point offset from the mouse, but I'm not sure how to compensate to get it to line up.
I wasn't quite sure how to describe my problem in the subject. I have a plane MC and a crate MC. The plane only flies along the y axis from the bottom of the screen to top. Along the way I want it to randomly drop the crate MC. My code is below. The problem is that the crates spontaneously keep spawning and not near the plane.
I am trying to calculate the top most intersection of an arbitrary number of planes, with no joy! I am using actionscript, but just need find an algorithm that i can implement.
Problem:
consider 3 vertical axis.The user enters 3 points for each triangle/plane such that the points of the triangle lie on one of the axis.The user can enter an arbitrary number of triangles I need to find the topmost layer of these triangles and display it on the screen as well as the coordinates of interection.
Here is a picture to clarify what I mean with 2 triangles:
However, when we allow for more than 2 triangles, I get awkward lines of intersection.
I have a Plane and I try tweening a MovieClipSprite on it. I run into trouble when I try to tween near the points where both segment triangles meet (I have kept both segments as 1), While moving near these points the Sprite disappears. I can tell it goes beneath the Plane because when it reappears it does so gradually and I can see it's lower half appearing as it moves away from these points. Increasing the segments obviously deteriorates the performance further as this begins to happen at other points as well. I am pasting some relevant code var planeMaterial:BitmapMaterial = new BitmapMaterial(texture.bitmapData, {smooth: true, precision: 4});
I'm not sure what the technical terminology is for what I'm curious about so hopefully my question will be clear (especially since I cannot upload a simple gif file for some reason).Let's say you have a fully fledged drawing application that keeps track of user input on a point-by-point basis and renders the user input as it is added. Let's say that the user's hand is shakey and that the line they draw isn't perfectly smooth. We will still draw the line as usual without any smoothing.
I've been trying to work on this simple vertical plane shooter. I got as far as creating everything and am now on the step to check if my bullet hits an enemy plane or an enemy bullet hits my plane. Because the enemy planes are created dynamically, I am trying to counter that with assigning then names when created so that the bullet knows what to look for. My approach for this might be somewhat wrong though. As for the enemy bullet hitting my plane, I just tell it to look for the instance of the plane already on the stage. Both result in the same error of undefined(the object can't be found).
Here is the code for both bullet collisions and the code for creating enemies. ActionScript Code: public function enemyHit(e:Event):void { //declare i var i:int; //check if the bullet hit any enemy object for(i = 1; i <= MovieClip(root).amount; i++) { if(this.hitTestObject(enemy + i)) { trace("enemy hit"); [Code] .....
The bullets have their own class files and the spawn enemy code is located within the fla file.
I want to create a basic flash file with a little plane that is constantly flying. It never stops just keeps on moving. Now it would be fairly simple to do that but i want to be able to rotate the plane using the arrow keys. Once the plan is rotated I want the plane to fly in the direction of the rotation.
I could easily keep increasing the planes x value but that will make it fly only to the right I want to be able to make the plane fly freely.
I'm working on a new project, its a side scrolling game where an airplane (user) has to shoot down a bunch of other enemy planes. how to create an AS to shoot lasers from the nose of the plane
Here is my setup, I have an MC with a line, this line is tweened to move to the right, using a custom easing tool, it has a very elastic animation to it. It then, with similar elastic effect, moves back to the left. I also have an MC with a box placed directly right of the line. What I want to do is get the box to contract then expand based upon the x location of the line mc. My reason for this is that the elasticity of the animation for the line would make it very difficult for me to do this manually get the effect I desire, so I'm assuming theres some simple property I can use that calls the location of x then sets the proportions of the box based upon that.
I have a program to draw straight lines in a coordinate plane.i create a movie clip ans input ywo pints of the first line and the line is drawn.But when i input the second data of the second line, the new line is drawn but the first line disappears.
i am trying to draw in flex in all four quardrants!i mean i have a 2-d plane,and i have values that i have calculated now i need to draw these in a plane! i tried the plotchart, but it only works in first quadrant,it doesnt take negative values!
I am trying to build a portfolio application similar to the used by Whitevoid. I am using Flex 4 and Papervision3D 2. I have everything working except for one issue. When I try to load an external SWF as a material on one of the planes, I can see any native Flex or Flash components in their correct positions, but the papervision objects are not being rendered properly. It looks like the viewport is not being set in the nested swf. I have posted my code for loading the swf below.
private function loadMovie(path:String=""):void { loader = new Loader(); request = new URLRequest(path);
[Code]....
Below I have posted two pictures. The first is a shot of the application running by itself. The second is the application as a MovieMaterial on a Plane. You can see how the button created as a spark object in the mxml stays in the correct position, but papervision sphere (which is rotating) is in the wrong location.