3d Projection
hey folks
i'm having trouble projecting a simple movement of a ball for a pong-style game from 2d to 3d. the code i'm currently using simply stretches the movement along the axis so that a 2d rectangle (the turf) becomes a parallelogram in 3d. but that does not make for perspectivical distortion (i want the far side of the turf to be shorter than the close side). i really have no clue how to do this cos deflection angles would have to be adjusted also. this is the relevant passage of code
Code: onClipEvent (load) { moveX = 5; moveY = 2; moveZ = 0; XPos = 0; YPos = 0; ZPos = 0; x = this._x; y = this._y; }
onClipEvent (enterFrame) {
if (moveX != 0) { this._x += moveX; this._y += (moveX*0.7); XPos += moveX; } if (moveY != 0) { this._x += moveY; this._y -= (moveY*0.15); YPos += moveY; }
// deflection off borders if (XPos>=250 || XPos<0) { moveX *= -1; } if (YPos>=200 || YPos<-10) { moveY *= -1; }
//resizing of ball to simulate depth this._xscale = (this.XPos/4)+40; this._yscale = (this.XPos/4)+40;
}
i attached the source if you need to have look (the relevant code is inside the ball's actions)
FlashKit > Flash Help > Flash ActionScript
Posted on: 10-18-2004, 04:26 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
2D -> 3D Projection
Hi
I'm working on an idea which involves a simple 2D image in flash and what I want to do is that when the image is clicked on, it loads a 3D image which sort of looks as if it has been projected off the 2D one. Too confusing?? Ok image that you have a piece of A4 paper in front of you and there's an image on it (2D). Now imagine that this 2D image is projected above the paper in 3D space and you could move it around etc.
Basicly what I have is a 3D model and I have saved it as a jpg. When the jpg is clicked, how can I load the 3D model and allow the visitor to move it around (i.e. rotate etc)?
Cheers
Loadmovie & Projection
i load external jpeg in my swf who' s working fine.
when i create a projection (pc) i can't see my jpeg who are loaded by a loadmovie.i try whith a loadvar for variables in a .txt file and it wont work.
Any suggestions?
thanks in advance
Projection & Loadmovie
i load external jpeg in my swf who' s working fine.
when i create a projection (pc) i can't see my jpeg who are loaded by a loadmovie.i try whith a loadvar for variables in a .txt file and it wont work.
the .exe is working normally with internal movies and not with external jpeg.
WHY?
thanks in advance
Point Projection
I guess I will start at the begining.
I have embarked on the journey to build my own collision engine.
The majority of it is finished.
I use collision detection to test whether the segment created be the old coordinants and new coordinants of my object intersect with the segment created by an set of coordinant. If the intersection has happened the angle of the object is mirrored of of the second set of coordinants (like a mirror).
Here's where I seem to be stuck...
Given the coordinants of the point of intersection and the angle of my reflected line I need to calculate the coordinants of the point out a certain distance (the distance is variable, it is the distance the line traveled after intersecting the line).
So here are the knowns:
the coordinant of the point of intersection.
the angle of the reflected line.
the distance the point must be away from the point of intersection.
Here is as far as I have gotten on this part:
let (dst) represent the distance the point needs to travel.
let (m) represent the slope of the reflected line.
we will give the point of intersection coordinants (0,0) and substitute the actual coordinants after all calculations have been made.
let (x1) and (y1) represent the coordinants of the resulting point.
let (x2) and (y2) represent the coordinants of the point of intersection.
( ^ denotes raising to a power)
dst = sqrt((x1-x2)^2 + (y1-y2)^2)
dist = sqrt((x1)^2 + (y1)^2)
(y1) must equal (x1) times (m)
dist = sqrt(x1^2 + (x1 * m)^2)
the equation must be solved for x1
once x1 is found, y1 can be extrapolated and the coordinants can be moved relative to the point of intersection.
Camera Projection
I'm not really sure how to explain it.
In some flash cartoons I have seen in the past, there is a box that moves about on the screen that can change size, rotation etc, which is the camera
Basically, you can zoom in on a character or something like that without having to resize the whole scene, just the camera object.
How can I achieve this?
any help is appreciated!
3D Objects/Projection
I am trying to port my game to CS4. It was using CS3 and some fake parallax (2D objects on 3D planes) it was done via a small scale/position modification.
In CS4, I am using the z component and failing miserably.
Collsions are based on Oriented Bounding boxes which are constructed using the (x,y) and the width/height of a movieclip. in CS4, 2 objects can have the same x,y but if they are on different z, the width/height will be smaller.
What I want is away to find the x,y of a movie clip after it has been projected on the stage (screen).
Image:
http://img512.imageshack.us/img512/8113/screenoe3.jpg
.exe Projection With Swish And Flash 5
hi all
i have make a graphical interface in Swish trial...and now i want import and export in flash 5 for make a .exe projection for put in one cdrom...
i thinks is really difficult to export from Swish and import in flash 5 for
make god job..
If i undestand is not possible to make a .exe without keep also the .swf
file together....
I have read all Swish help file....and i have see i propose 3 method of
import in Flash 5...
i have test for many hours all solution..and i thinks the only method work
correctly is the method using " Load movie Action ".
The problem like that is i must keep the .swf together for my .exe work....
With the 2 other solution i get always something wrong....
have you another solution using only 1 file and not 2 ??
Same with .hqx file...my Mac don't want run the .exe file without the .swf file....
Who have experience with Swish and Flash for make working .exe projection...and also for Mac...
thanks in advance
for any help
regards
Mirko
[F8] Advise On Project For Projection Please.
Hi there,
I was hoping to get some advice on a project I'm undertaking, It's an advertising animation for a drinks company, to be projected onto screen at nightclubs.
So far my main concerns are thus:
Frame rate: I have this set to 24fps, yet some of the graphics still seem to judder on screen, so I guess I'd like to know why, and how to improve them.
Resolution: I am slightly concerned about how the final projection will look on a big screen, as compared to my 1024 x 768 screen, has anyone any idea if it suffers much?
Text: Although 99% of the project text is symbols, whats the best way to ensure that text output is as designed, when not symbols?
I am using Flash 8.
Thanks in advance for any feedback, it will be greatly appreciated.
Dav.
Flash And Beamer Projection
Hi,
I have been asked to make a flash presentation that is going to be projected by a beamer.
I wonder what the specs are that I need to consider.
Does anyone happen to know a link/literature about that?
I guess it's okay with using vector, but how about bitmaps? Should they have some minimum dpi or some kinda resolution?
Does a beamer have a certain resolution?
How about video?
I mean, blowing up things really can make it look bad I guess.
I'm pretty blank on this subject, so i hope you can give some info,
thanks,
JerryJ.
Projection: Right Click = NextFrame ?
hello code poets,
I'm working on a projection where I need to put a NextFrame() action on a simple right mouse click, and a PrevFrame(); on the mouse left click.
The flash documentation is not very helpful to me with the someListener.onMouseDown ... ;(
Do you have any idea how I should do this?
Thanks a million for your help,
Val.
Transparent Background (Projection)
Hello. I wonder if anyone can help.
I'm to make a flash movie advertising a product. The movie is to be projected onto a screen. I have a couple of questions regarding this.
The client requests the movie to be contained in circle. The movie plays in a circle fine, however the background shows around the circle. Can this be made transparent so only the circle with movie in is projected?
What is the best resolution to design for a projected image? I have chosen 1024 x 768. Does anyone have any suggestions regarding this?
Many thanks in advance.
Full Screen Web Projection
I have always authored my sites to fit in a tidy little rectangle of 700 x 400 px, give-or-take, centered on a solid colored HTML generated background. I notice that the trend lately has been for people to create a Flash site that may have the nucleus of the site within similar dimensions, but the entire screen fills with an image or animation behind the main body of the site (ie http://www.fa-d.com/). How do you create an image/animation in Flash that detects and fills the monitor size of the site visitor without compromising the quality of the image, pixelating, and forcing a huge download for your visitors as with the example that I've supplied above? I've tried "View Source" on these sites and only get the Flash Player settings, so I assume the background and the site contents are all generated within Flash and not a combination of HTML and Flash as I've traditionally done.
Thanks in advance -
Trig Projection Problem
I've been working with ActionScript a little while, and I'm trying to figure out how to do basic trigonometric projections. I've been following a tutorial at metanet.com, and I can't seem to get it implemented correctly.
What I have is the attachment.
Please reply.
Projectile Path Projection
This is just a little something that I was thinking about. It's a very small script, but may help someone who is wanting to achieve such an effect. Enjoy
ActionScript Code:
Stage.align = "TL"; Stage.scaleMode = "noScale"; _quality = "medium";var startX:Number = 0; var startY:Number = 0;var mouseIsDown:Boolean = false; var gravity:Number = 20;_root.onMouseDown = function() { startX = _xmouse; startY = _ymouse; mouseIsDown = true; }_root.onMouseUp = function() { mouseIsDown = false; }_root.onEnterFrame = function() { _root.clear(); if (!mouseIsDown) { return; } _root.lineStyle(1, 0xCCCCCC, 100); _root.moveTo(startX, startY); var hVel:Number = _xmouse-startX; var vVel:Number = _ymouse-startY; var t:Number = 0; var x:Number = startX; var y:Number = startY; var draw:Boolean = true; while (y < Stage.height) { t+=0.1; //how detailed the line is. 0 = infinitely detailed (don't use this, obv) x = startX + hVel*t; y = startY + vVel*t + 0.5*gravity*t*t; if (draw=!draw) { _root.lineTo(x, y); } else { _root.moveTo(x, y); } }}
Projection Of Velocity + Gravity
I am making a game similar to worms, and i was wondering if there is a way to calculate a curved line from the velocity, gravity, wind etc.
This way i can check where it is going to land.
The only way i can think of is a while loop and updating the calculated position, and making a curved line from lots of smaller straight lines.
Is it possible to do this without the loop? and have a "pure" curved line.
Trig Projection Problem
I've been working with ActionScript a little while, and I'm trying to figure out how to do basic trigonometric projections. I've been following a tutorial at metanet.com, and I can't seem to get it implemented correctly.
What I have is the attachment.
Please reply.
Projection Based On Angle
I have a movieclip that rotates based on where the mouse is at. What I'm trying to do is create a projectile that comes from the movieclip and heads towards the mouse at the correct angle. I already have the movieclip rotating properly i just need to know how to calculate the rotation of the projectile and the direction based on the mouse position.
Thanks
No Window Resize - Exe Projection
Can anyone please tell me how I can go about making it so the exe outputted from flash does not allow for resizing, I know of one or two expensive projectors that can do it, but they seem to break something else whenever I test them out. I have used some free exe modifiers such as exeBat and ResHack in order to change the icon, and title bar text, however I am unsure if these applications can do this last thing that I require.
Now I have tried the
fscommand("allowscale",false);
and it doesn't work. If anyone knows of any other free / cheap apps that can do this last thing that I require that would be great, or if there is code that works that will not allow for resizing the exe that would be great too. Any help will be greatly appreciated, thanks.
Unusual Projection Problem
I'm using Flash MX in the projector mode to use in class on a movie screen on the wall. I've been trying to "cheat" on a video capability by using the Windows media player in the "stay on top of all other apps" mode. Dumb, I know . . .But the videos are like 4-6 minutes long a take up thousands of frames.
When I lauch the video, I have to <fn> F8 twice to reveal the video, but it fills the screen. And, it looks/sounds really crappy as it cycles through. I want to confine the video to the lower left corner, about 25% of the frame.
How can I have a constant video window present that plays when I reach a certain point in the presentation and invoke it manually, keeping the video in the designated part of the frame and in such a way that it doesn't drag on my flash movies which run concurrently (Resources are not a problem--I have a fully-loaded Dell M60, though it only has a 1.8 GHz coprocessor)?
Building A Flash MX Projection, Questions
Hi there,
I need to make a projection, a sort of slide show that will be showed in a big wall in front of 400 peoples. [ no web use ]
It won't be difficult ( i hope ), i am not gonna use lots of script , just some animation and about ( 50 --> 100 ) pictures ( good quality ).
I need to put at lest 4/5 songs in it .
I saw an example time ago from the same guy i am working now and the SWF was made by a very big Media studio, nothing compared with me and my laptop and i notice something strange.
Those guys made a Main SWF with some external SWF .
Main = 25 MB
others swf = around 15/20 MB each.
Because of the swf sizes somethimes the projection it wasn't really smooth.
The main swf has the flash player icon (!?)and when u click on it will open the movie FULL SCREEN.
So, some questions ?
Stage size matters ??
swf suggested size ? ( don't know what type of CPU will handle the stuff)
I can i make the main movie looks like the f. player ( just swapping the icon...i don't think so) ?
Any suggestion about the music ( mp3 ), can i just drop some song on the main timeline ?
I am terribly afraid that my movie will be stretched on the wall and the pics will look horrible.I can't make tests , so i need to know if what i see on my 14" screen will be the same in a big wall.
I know vectors animation does not have problems but as i said before i got some dubts x the pics.
Please any suggestion will be well accepted.
ps = Jubba were r u gone ??
Pitfalls To Avoid Using A Giant Screen Video Projection (barco)
Hello,
Can you tell me in details what are the pitfalls to avoid
when doing a presentation on a giant screen (barco video projection)
I use a flash MX *.exe.
I have no access to the material to this is vital for me !
Thanks a lot for your help !!
Tony
Opening Popup Page In Standalone Projection (no Html Mother Page)
Hello,
I am creating a standalone projector (CD with autorun).
This means my swf files are NOT contained within html.
I would like to, when clicking on button, open a popup html page with specific dimensions.
I was wondering if it is possible to do that, and what AS to use,
or if I have the obligation, to openpopups, to launch my swf files WITHIN html mother page.
HERE IS THE CODE OF MY BUTTON THAT WORKS (but does not open popup):
on (press) {
getURL("URL", "_blank");
}
HERE IS THE CODE FOR POPUP BUT DOES NOT WORK (opens html page normaly):
on (press) {
getURL("URL", "", "width=580,height=400,left=100,top=100");
}
thanks guys.
Opening Popup Page In Standalone Projection (no Html Mother Page)
Hello,
I am creating a standalone projector (CD with autorun).
This means my swf files are NOT contained within html.
I would like to, when clicking on button, open a popup html page with specific dimensions.
I was wondering if it is possible to do that, and what AS to use,
or if I have the obligation, to openpopups, to launch my swf files WITHIN html mother page.
HERE IS THE CODE OF MY BUTTON THAT WORKS (but does not open popup):
on (press) {
getURL("URL", "_blank");
}
HERE IS THE CODE FOR POPUP BUT DOES NOT WORK (opens html page normaly):
on (press) {
getURL("URL", "", "width=580,height=400,left=100,top=100");
}
thanks guys.
|