Actionscript 3 :: Papervision3D: Making A Camera Look At Plane
Jan 6, 2010
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'd like to keep an object appear to remain in the same place while moving the camera.I'm using this scriptto orbit an object using a mouse drag. But I have an object in the scene that I would like to keep still. How to I do this?
So I'm going to have a wall of cubes and basically, I don't want to see the sides of them. I just want them all to be facing directly into the camera (so basically you'd just think it was a bunch of squares to begin with). The problem is, with the default focus and zoom values, naturally I can see the sides of the cubes nearer the left and right of my scene but I'm not sure what zoom/focus values would help me achieve this. Is this actually possible!? Basically I just want to be able to do 3D stuff with INDIVIDUAL boxes and I can't think of a way of doing it without using a separate scene for every box (which would allow me to put all of them effectively at 0,0,0)!
I'm making music visualization in papervision3d using FlashDevelop. The script generates 150 cubes each acting as different tone (from basses with red colors to high notes with blue).The song starts, everything works fine, but after 44 seconds song stops. I hadn't wrote function that would do that. I've turned off every useless visual functions and even papervision3d rendering. The scene is just black and the song still stops playing after 44 seconds.File is included with:
Code: [Embed(source = "../assets/8bp069-05-she-session.mp3")] because I'm not writing it in flash.
I've tried different song and it stops after 1:10...Flash uses ~30MB of Ram and 50% of my Athlonx2 64 2.6Ghz in action.
Here's some code: sound
Code: [Embed(source = "../assets/8bp069-03-she-pioneer.mp3")] private var Music:Class; private var sp:Sound = new Music();[code].........
those last 3 functions have nothing to do with playback.Am I doing something wrong with computeSpectrum function? Here's the scrieennie of it in action: Of course it's like an alpha version of what I'm planning to do.
making a camera roll AND track at the same time?All the 3D tutorials I've found deal with rotation OR camera movement, but never both at the same time. Can't quite get it to work, so I must be missing something.
I am capturing camera on flex for android using air 3.1,and found that the camera is only showing the a part of of actual camera video.When i view camera using normal camera application in android galaxy tab, it shows full camera area but when i am capturing the camera in flex its showing only the center area for it.I tried using setMode to set the resolution, but its not of any use.Is there any way to get full camera area captured inside flex using camera.getCamera ?
From a Flash object, I would like to be able to detect the presence of a webcam that the user might grant access to, without actually asking the user whether they want to grant access. This is to streamline a large application that has extra features if a webcam exists — if there is a webcam, the application will present several dialogs that lead up to the normal cam-security prompt, but if the user doesn't have the hardware, I want to skip over them altogether. Requesting access to the cam before those dialogs won't make sense to the user.
It appears not to be possible to call Camera.getCamera() without the security prompt happening. Is there a workaround? (For instance, could I, perhaps, call getCamera in a hidden Flash object and inspect its return value, or does it block until the user acknowledges the security prompt?)
I have a video capture device on a machine. I have written a windows application to capture the video from this device. While capturing, if i try to broadcast using flash it does not connect. If i'm already broadcasting and then try to capture then my windows application does not get the capture pin of the device. So, flash seems to be taking the capture pin. Is there anyway to broadcast using the preview pin on the device so that i can capture using my application. Or is there way where i can split the capture pin and give one to my app and one to the broadcaster
Usually Adobe Flash applications can access any usb-webcam.I have a USB camera for microscopes which understands TWAIN and DirectShow.Is there a possibility to access the video data from this camera with flash?
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 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});