Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Object Rotation And Movement



I am currently trying to make a game where an object is rotated/aimed (360 degree rotation) using the 'left' and 'right' keys on the keyboard, and then a mouse press on the object will bring up a power selection bar (similar to the ones found in golf video games) and releasing the mouse will project the object in the selected direction/angle with the chosen power level (so the power rises when the mouse click is down and the power is chosen when the mouse is released).

Right now I have coded part of the game, however, it is not exactly how I would want it. I currently have a rotation selected by the tracking of the mouse pointer on screen, though that is not what I had originally planned.

Moreover, the powerbar I have implemented currently is just a movie clip with each frame setting a powerlevel variable to a higher level (as was suggested by a poster here previously). I will also be using a different movieclip object for a different animation of the object to be played when the object is being projected.
I am just looking for a simple projection and landing of the selected object.
This game will be a two player (turn-by-turn) game.

Any help on the simplest way of implementing this would be greatly appreciated, as I am currently clueless.
Thanks.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 03-29-2006, 03:38 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Object Rotation With Mouse Movement
hi all, can anyone help me to obtain an effect similar to this one? (visit the following link)

http://www.sony-latin.com/handycam/.../3d_dvd101.html

i already know that the rotation moving over the squares on the bottom is made with a "on rollover...gotoandstop" action..isn't it?... but i don't know how to control the rotation using the mouse.
try to click and drag the camera image in the example...
i don't mind about zoom and y-axis rotation, i'd just need x-axis rotation...any suggestion?

thanks...bye

Object Follows Cursor With Rotation Towards Movement But Flips
Hi

Can anyone help me to figure out why my object flips awkwardly when it follows the mouse. I added an ease line on the rotation but it still flips. I'm scratching me 'ed.

this is the code attached to the mc


onClipEvent (load) {
//_x = 0;
//_y = 0;
speed = 6;
area = 0;
}
onClipEvent (enterFrame) {

//attach mc to the pointer if mouse over the area
if (area == 0) {
this.play();
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;

//rotate MC to follow the mouse angle
this.onMouseMove = function() {
_rotation = (Math.atan2(_root._ymouse-_y, _root._xmouse-_x))*(180/Math.PI);
ease = 3;
};
}
}

Much appreciated in advance

Rotation And Movement Using AS
hi,

I have an actionscripted button, that when pressed executes some code.
button.onPress = function() {...
} etc

the code simply rotates and moves the x and y co-ordinates of a mc, but at the moment the co ordinates I have in them onPress simply just places them there.

I would like a smooth transition/motion of the MC rotating and changing etc

i have at mo

button.onPress = function() {

my_mc._x=300;
my_mc._y=230;
my_mc._rotation=120;

}

whats the best, I have tried a for loop etc but still execute fast

would a tween class work etc (new to this class)

Using FlashMX 2004 Pro
thanks si

Rotation And Movement
Hi guys
I have a flash file in which i have a red sphere[a movieclip] (ball_mc)
The file has been attached!
In this i have inserted the following code:

Code:
onClipEvent(enterFrame) {
this._rotation+=5;
}
ya fine this does start rotating the Ball in its own place
But i want sumthing more
As it is rotating it should also move from one end to the other
So i created motion tween
but that did not make it happen
It still rotated at its own place
i tried out

Code:
onClipEvent(enterFrame) {
this._x+=5;
}
Even this didn't make it!!!
Help needed urgently
I know this is a simple one
Any sort of Help is admired!!!!!!

Rotation And Movement?
anyone know how u could go about making an asteroids like movement scheme? i have a normal 4-way movement set-up and would like another if possible.

Object Movement Based On Mouse Movement
Not sure how to word this but. I have a object on the stage lets say that is 300 pixels wide. The actual stage is only 100px wide. I want to be able to "pan" the object left and right based on mouse position/movement. I saw a tutorial for it a while back but cant seem to find it. Anyone have a link to a tut or can throw out a little source code? It would be greatly appreciated.

Movement Of One Object Dependant On The Movement Of Another Object
I am trying to get the browser to move the levers which in turn moves a constant laser beam.

The two levers control the beams position if you move the top beam it moves left to right, and the side beam controls the horizontal movement. I only want the beam and the levers to be moved to the following.

Horizontal lever between positions 10 and 2 o'clock (the levers rotate at a central point)

Vertical lever - between 2 and 4 o'clock

The laser beam to be moved anywhere in the red circle but once the lever is not being moved then the beam also stops moving.

I appreciate this is a big ask and would be grateful for any help

Please see attached.

Movement, Rotation And Confusion
Ok i understand the basic movement idea.. onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_x -= 20;
} else if (Key.isDown(Key.RIGHT)) {
_x += 20;
} else if (Key.isDown(Key.UP)) {
_y -= 20;
} else if (Key.isDown(Key.DOWN)) {
_y += 20;
}
}

but what if i wanted the left and right keys to rotate my mc in a certain direction and then when i press Up it goes in that direction?
also need a quick hint on collision theory with other mcs also if you can think or know of a way to make the movie clip slide around when it turns at high speeds and so on..

heh, its a fair sized ask but any help would be appreciated!
you guys are a great.. hope someone can help with one of my problems

Rotation + Movement In Portofolio
Hi

I'm developing a new site to showcase my work, both illustrations and websites.
I am total noob in actionscripting, so please help me out.

A wanna make this site, where thumbnails to my work all lies scrubbled at the bottom of the page, rotated and messy. Then, on mouse over one of the thumbnails, it should rotate back in horizontal position while moving about 40 pixels above the rest and displaying some info.

I made the movement work, mostly on behalf of http://www.webmonkey.com/webmonkey/0...?tw=multimedia , now i just need the rotation.

My code looks something like this, added to the first frame of my site:

_root.frame01_mc.onEnterFrame = function() {
_root.frame01_mc._y -= (_root.frame01_mc._y-finalpos_mc._y)*.65;
_root.frame01_mc._rotation += 10;
if (_root.frame01_mc._rotation>= 90) {
_root.frame01_mc._rotation= 90;
}
};

frame01_mc is the thumbnail
finalpos_mc is a movieclip, that tells how high the thumb should fly.

i attached an image to show what i mean

All help is musch appreciated.

Cheers

Character Movement + Rotation
Hello,
I am currently working on a car racing game but I am new to designing the engine for my game such as the physics for my car. So, I took help from a tutorial but could'nt quite understand the trigonometry part, can you explain it.
The part I did not understand was,
x = Math.sin(_rotation*(Math.PI/180))*speed;
y = Math.cos(_rotation*(Math.PI/180))*speed*-1;
if (!_root.hit.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.6;
}
}
Hope you can help me out,
Thanking You,
Chinmaya

P.S. I know how to convert degrees to radians and know a little about unit circles. The main part I dont understand is that why do we multiply the sin of angle(in radians) to the speed!







Attach Code

onClipEvent (load) {
speed = 0;
}
onClipEvent (enterFrame) {
// make the car go forward
speed += 0.1;
// tells the car to slow down after the speed of 20
if (Math.abs(speed)>20) {
speed *= .7;
}
// you can change the rotation of the car to your desire
if (Key.isDown(Key.LEFT)) {
_rotation -= 15;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += 15;
}
// here is where the hittest is for the boundary
speed *= .98;
x = Math.sin(_rotation*(Math.PI/180))*speed;
y = Math.cos(_rotation*(Math.PI/180))*speed*-1;
if (!_root.hit.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.6;
}
}

MC Movement, Rotation, And Position.
I'm having a problem with a little movement script I wrote for a MC I have.
I believe it either has to do with variable scoping, or with a coordinate system problem. (If I change the xPos and yPos in the onClipEvent (load) to 0,0...then the MC starts in the middle of the field (MC) I'm trying to move it inside of.)
Basically...the ActionScript you see below is a part of the "Player" MC...who is supposed to move around a "field" MC I have.

Any suggestions? (I was assuming setting xPos and yPos to 0 would have the Player MC starting at the very top left of the entire screen...which instead it starts in the middle of the "field" MC.) Also - When I press the different arrow keys...the Player MC jumps around to different locations...but once at the new location the movement (in a single direction) works okay.

I've attached the .swf in case someone wants to help me.


onClipEvent (load) {
speed = 2;
xPos = 0;
yPos = 0;
this._x = xPos;
this._y = yPos;
}
onClipEvent (enterFrame) {
//First, move the character.
if (Key.isDown(Key.UP)) {
yPos -= speed;
this._rotation = 0;
}
if (Key.isDown(Key.DOWN)) {
yPos += speed;
this._rotation = 180;
}
if (Key.isDown(Key.RIGHT)) {
xPos += speed;
this._rotation = 90;
}
if (Key.isDown(Key.LEFT)) {
xPos -= speed;
this._rotation = 270;
}


this._x = xPos;
this._y = yPos;

//Here, do the hitTests.

}

Movement And Rotation In Flash 8
Hello everyone! I am trying to make an Asteroids spin-off based on the tutorial at this page http://www.macromedia.com/devnet/fla...asteroids.html
using more complex movieclips and I'm using Flash 8. My questions are:

When I apply the code shown there to an existing movieclip (doing the necessary changes for names and instances) it doesn't work! I even tried just pasting the whole thing to a blank project and it will load the asteroids and draw everything, but the ship does not move nor does it fire. Now, I solved this problem saving it as a prior Flash version, but I'd like to know how can I do it with F8? The other thing is that when I turn the ship, it will turn as if the center was in the upper-left corner...How do I change this?

Thanks in advance!

Help With Rotation+movement For Portofolio
Hi

I'm developing a new site to showcase my work, both illustrations and websites.
I am total noob in actionscripting, so please help me out.

A wanna make this site, where thumbnails to my work all lies scrubbled at the bottom of the page, rotated and messy. Then, on mouse over one of the thumbnails, it should rotate back in horizontal position while moving about 40 pixels above the rest and displaying some info.

I made the movement work, mostly on behalf of this tut, now i just need the rotation.

My code looks something like this, added to the first frame of my site:

_root.frame01_mc.onEnterFrame = function() {
_root.frame01_mc._y -= (_root.frame01_mc._y-finalpos_mc._y)*.65;
_root.frame01_mc._rotation += 10;
if (_root.frame01_mc._rotation>= 90) {
_root.frame01_mc._rotation= 90;
}
};

frame01_mc is the thumbnail
finalpos_mc is a movieclip, that tells how high the thumb should fly.

i attached an image to show what i mean

All help is musch appreciated.

Cheers

Portofolio Explenation.gif

MC Movement, Rotation, And Position.
I'm having a problem with a little movement script I wrote for a MC I have.
I believe it either has to do with variable scoping, or with a coordinate system problem. (If I change the xPos and yPos in the onClipEvent (load) to 0,0...then the MC starts in the middle of the field (MC) I'm trying to move it inside of.)
Basically...the ActionScript you see below is a part of the "Player" MC...who is supposed to move around a "field" MC I have.

Any suggestions? (I was assuming setting xPos and yPos to 0 would have the Player MC starting at the very top left of the entire screen...which instead it starts in the middle of the "field" MC.) Also - When I press the different arrow keys...the Player MC jumps around to different locations...but once at the new location the movement (in a single direction) works okay.

I've attached the .swf in case someone wants to help me.


onClipEvent (load) {
speed = 2;
xPos = 0;
yPos = 0;
this._x = xPos;
this._y = yPos;
}
onClipEvent (enterFrame) {
//First, move the character.
if (Key.isDown(Key.UP)) {
yPos -= speed;
this._rotation = 0;
}
if (Key.isDown(Key.DOWN)) {
yPos += speed;
this._rotation = 180;
}
if (Key.isDown(Key.RIGHT)) {
xPos += speed;
this._rotation = 90;
}
if (Key.isDown(Key.LEFT)) {
xPos -= speed;
this._rotation = 270;
}


this._x = xPos;
this._y = yPos;

//Here, do the hitTests.

}

Link Rotation To Mouse Movement
I have an mc that rotates around a central axis, i want to link the movement of the mouse to the rotation of this mc. basically i want the mc to rotate either clockwise or counter clockwise depending on the movement of the mouse on the stage being either clockwise or counter clockwise in relation to that same axis.

cheers.

Link Rotation To Mouse Movement
I have an mc that rotates around a central axis, i want to link the movement of the mouse to the rotation of this mc. basically i want the mc to rotate either clockwise or counter clockwise depending on the movement of the mouse on the stage being either clockwise or counter clockwise in relation to that same axis.

cheers.

Tweening Rotation Independent Of Movement
So I have a situation where I need an object that's in motion to suddenly start to rotate about halfway through its move. How exactly do I do this? It seems like keyframing locks in the transformation data for EVERYTHING instead of simply what's changing. If that's not the case, I'd love to know the process that allows me to pick transformation elements at will. And If it is the case, then is there a way around this ridiculousness?

Simple Way To Detect Movement Or Rotation?
Is this possible? I know its possible when you use variables that keep records and track back and forth when an x or y has changed or _rotation has changed, but is there any way to tell:

if(myObject has moved any pixels) {}

or

if(myObject has rotated any direction/amount) {}

?

Clip Rotation For Movement: A Newbie Asks
Hi All,

I pretty new to actionscript and following a few tutorials. I've been playing with one that moves a movieclip towards the point at which you click the mouse and wanted to rotate the clip towards the target point.

I have it almost working but when you click the mouse on or very close to the x or y axis of the clip the rotation angle gets all screwed up. As soon as you click further away from them the rotation returns to normal.

Here's the code in the movement frame of the clip:

//calculate movement rate for each axis
x = Math.abs(xstart-xtarget);
y = Math.abs(ystart-ytarget);
if (x>y) {
xspeed = 5;
yspeed = 5*(y/x);
} else {
yspeed = 5;
xspeed = 5*(x/y);
}
// Calculate the angle from the current clip position to the target position
angle =Math.atan(x/y);
trace (angle);
// Convert from Rads to Degrees
angle = angle*57.2957;
//Check which quadrant the target is in and adjust accordingly
if (_x<xtarget and _y<ytarget) {
angle = angle+90;
}
if (_x>xtarget and _y>ytarget) {
angle = angle+270;
}
if (_x>xtarget and _y<ytarget) {
angle = angle+180;
}
//Rotate the CLip
setProperty (this, _rotation, angle);
trace (angle);
//Move the clip
with (_root.arrow) {
if (_x>(xtarget+2.5) || _x<(xtarget-2.5) || _y>(ytarget+2.5) || _y<(ytarget-2.5)) {
if (_x>xtarget) {
_x = _x-xspeed;
} else {
_x = _x+xspeed;
}
if (_y>ytarget) {
_y = _y-yspeed;
} else {
_y = _y+yspeed;
}
}
}

The basic movement tutorial was from actionscripts.org

Thanks in advance

Keith

Trigonometry Mouse Rotation And Movement Of A Character
Hi Everyone,

I was wondering if anyone knew a script for making a MC rotate by moving the mouse, and then making him move what ever way he is facing by pressing the "up" arrow.

Any answers would be appreciated

Thanks,

Mr_Welfare
_______________________
Flash MX 2004 Professional

Object Rotation
I'm working on a pretty cool project which consists in controling a satellite antenna via internet. I'm working on the graphic interface and i'm trying to make an animation in which i could show a dish antena that moves in a certain direction (so that it faces a specific satellite). Anyways, here's my question.

1.How do i rotate objects to a specific place. Let me explain. Let's say i have a line and i want that line to rotate X degrees how do i make that animation???? The idea is that for different frames the line will rotate a different angle, so the idea is to create a routine so that i don't have to make an individual animation for each case, but make a script so that i just enter the angle i want the line (or object) to rotate and... voila!!!!

2. Now, lets say i want that line to return to its original position once i change the frame, how do i do it???

Rotation Around Object
I want to have an object rotate around a point or object. Can someone please help? Thanks

Object Rotation
hi all, can anyone help me to obtain an effect similar to this one? (visit the following link)

http://www.sony-latin.com/handycam/n...3d_dvd101.html

i would just need x-axis rotation...any suggetion?

thanks...bye

3D/2D Object Rotation
Hello Flash Developers,

Can you recommend a good book(s) on general Flash project design? I am participating in a project that may have a fair amount of animation, navigation (perhaps using Captivate), and some sort of 3D animation, like some sort of rotating image (a part, or object). This project may also have some zoom requirements. Like to zoom in on an object to see greater detail (aka the MS and Google satellite maps, etc). I would like to know the feasability of doing this type of work using flash, or is it not the right application for a project that may require 3d rotation, and zooming.

Thanks,
eholz1

Rotation Of An Object
I need help getting on the right track if someone could help I would be grateful.

I have a six sided polygon with segments of different colors. When I click on a segment the program recognizes the color then rotates the polygon so that the segment that was clicked rotates to the top. i.e. click on red the polygon will rotate 300 deg, click on green and the polygon rotates 120 deg and so on. This all works fine on the first click but after that there is no telling where on the polygon the next segment now is. Any ideas how I can set it up so that the angles are reset to known angles after the first click, so that on the second click the polygon knows how far to rotate.
I tried static hidden buttons over the top of the polygon and that worked well but the getPixel() would not get the color through the hidden button and I need that color to trigger another action.
I know this sounds complicated but I am sure there is a way to do this but everything I have tried fails in some way or another.

Rotation Of Object Following Mouse
I need to rotate one object according to mouse position any guidance?

I am doing atan() function, and get stuck at place where i need to convert e.g
value 1 to 45 degree, i don't know how to do that,

thanks in advance
Arun

[F8] Rotation Of Current Object
Hi, got myself in a pickle again.

Been working on a bathroom suite designer which I eventually aim to connect out to a payment web page collecting all the items. Originally I was planning to store the x & y + direction attributes aswell but I've not even started with xml or php yet anyway.

My first question is selecting the current object and rotating, my code is:

Code:
stop();

var current:String = 'empty';

rRight.onRelease = function(){
_rotation += 90;
}

rLeft.onRelease = function(){
_rotation -= 90;
}


I'd like the rotation to correspond to the variable current, any ideas?


-----

Second question is the objects on the stage that I've resorted to using the following code:

Code:
on(press){
this.startDrag();
}
on(release){
this,stopDrag();
_root.current = this._name;
}


For some reason I cannot push this into the non-object code section, I thought I could use O1.onPress = O2.onPress... = function(){} but I was getting a syntax error i also had O1.onRelease to cover the other of the above code, any help there?

I've posted a copy of what's going on at this link , thanks for looking

Object Rotation Script
I have created a speedometer in flash and i want the needle to rotate along with cursor. I want to only rotate the needle and not move it. Donno where to start. Can anyone one help me with the script?

Using GetBounds After Rotation Of An Object
Hi everyone,

I have a function which draws triangles, and another function that rotates the triange and another function that gets the bounds.

I thought I should make a small sample file if needed.

The problem I'm having is when I use mc.getBounds(mc._parent) after the triangle is rotated is not returning the true boundaries of the shape in the parent coordinates.

I don't know of any other way to get the boundaries of a shape

Object Rotation Question
Hi,

I've got a movie that's like a "spin & win" You click spin, and it goes to a frame with my mc that has the following code on it:

onClipEvent (enterFrame) {
i = getProperty(this, _rotation);
setProperty(this, _rotation, i+-20);
}

So, it's just automatically spinning. Is there a way for when you click on a button (stop) it stops that rotation? The only way I could figure to do it is when you click stop, it goes to a 3rd frame with a still image.

Hope this makes sense and that there is another solution out there!

thanks

Constant Rotation Of An Object
I'm trying to get a movieclip to constantly rotate either left or right.
At first I set this._rotation=-1
Then I was thinking of using

if (this._rotation==1) {
this._rotation = -1;


But this only makes the object rotate 1 degree and then stop. How do I make it constantly rotate?

Dynamic Object & 3D Rotation
I'm creating a sprite dynamically and want to rotate it (using rotationY[3D]) around the center of the object.

I know you cant change the registration point of an object dynamically so is this even possible? Maybe using Matrix3D?

Object Rotation Question
Hi,

I've got a movie that's like a "spin & win" You click spin, and it goes to a frame with my mc that has the following code on it:

onClipEvent (enterFrame) {
i = getProperty(this, _rotation);
setProperty(this, _rotation, i+-20);
}

So, it's just automatically spinning. Is there a way for when you click on a button (stop) it stops that rotation? The only way I could figure to do it is when you click stop, it goes to a 3rd frame with a still image.

Hope this makes sense and that there is another solution out there!

thanks

Object Rotation From Mouse
ok Mr Bill Watson worked this code up for me and it works.. but i have tried tweaking the numbers but i cant get it to work acuratley.  what this does is makes a movie clip of a gun that sits in the bottom right hand corner of a 750X450 movie rotate with the cursor .. so the gun is pointing where the cursor is.

gun.onMouseMove = function(){
    temp1 = _xmouse;
    temp2 = _ymouse;
    wildGuess = 30;
    len = (650-temp1)*(650-temp1)+(311-temp2)*(311-temp2)
    hyp = Math.sqrt(len);
    len2 = (650-temp1)/hyp;
    angle = Math.sin(len2);
    this._rotation = -angle*wildGuess;
}

that works but it dosent follow accuratley

any one have suggestions on tweaking it?

Object Rotation? Answer Please...:D
how do i get an object to rotate clockwise when I push the right arrow button...does anyone know the code for that??? thanx for all answers

Object Stacking And Rotation
here is a picture of what im trying to do:
http://www.pixelsumo.com/temp/screen/
(static image)

the white box contains the red objects. you can click on the rotate handles on the box (got this working already) and rotate the white container.
The red objects should fall and settle (stack on each other) towards the ground (down). I know how to stack these objects on a flat surface, but not sure how to handle the rotation of the container space.

I'm really having trouble getting started on this, so if anyone has any ideas I'd be really grateful.

ps - my actionscript is intermediate, so you aren't talking to a complete novice, just a novice at maths based stuff

Advanced - Object Stacking And Rotation
here is a picture of what im trying to do:
http://www.pixelsumo.com/temp/screen/
(static image)

the white box contains the red objects. you can click on the rotate handles on the box (got this working already) and rotate the white container.
The red objects should fall and settle (stack on each other) towards the ground (down). I know how to stack these objects on a flat surface, but not sure how to handle the rotation of the container space.

I'm really having trouble getting started on this, so if anyone has any ideas I'd be really grateful.

Ive also posted this in the math forum.

Rotation Of A MovieClip And Object Inside Of It
MC==MovieClip
i have a MC which rotates a whell :
http://www.flashoo.co.il/eitan/wheel_g.swf
in the MC i have bakets that move awith the whell when it rotates.
and to keep the bakets a feeling of a real moving i do :

PHP Code:



wheel.onEnterFrame=function(){
  this._rotation+=1;
  this.baket1-=1;
}




the thing is if i want to check which of the bakets have reached the top of the wheel i cant!
beaucse if i try to check the _x or _y values of baket1 i recive a value like the baket has never mover from its start position!?!?!?!?
why is that?
how can i check which baket is on hte top?
thnaks i nadvance
peleg

Rotation Of A MovieClip And Object Inside Of It
MC==MovieClip
i have a MC which rotates a whell :
http://www.flashoo.co.il/eitan/wheel_g.swf


in the MC i have bakets that move awith the whell when it rotates.
and to keep the bakets a feeling of a real moving i do :

PHP Code:




wheel.onEnterFrame=function(){
  this._rotation+=1;
  this.baket1-=1;
}






the thing is if i want to check which of the bakets have reached the top of the wheel i cant!
beaucse if i try to check the _x or _y values of baket1 i recive a value like the baket has never mover from its start position!?!?!?!?
why is that?
how can i check which baket is on hte top?
thnaks i nadvance
peleg

Moving An Object Based On Its Rotation
I'm trying to make a 2D space game where you can control a space ship's rotation and its acceleration. I want the space ship to accelerate in the direction it's facing.
I have no idea how to do this, so if anyone could help me that would be great.
I've attached my .fla and .as files if you wish to look at what I have so far, but there's hardly any code related to this issue.

Moving An Object Given Rotation Angle
just need the code templet for moving an object in the direction it is angled at(the rotation). I never learned how to do it but if someone game me the code it would really helpful?

Moving An Object Given Rotation Angle
just need the code templet for moving an object in the direction it is angled at(the rotation). I never learned how to do it but if someone game me the code it would really helpful?

Object Vr (360 Degree Rotation Using Images)
A few years ago, I found a great tutorial on how to do these: http://www.vw.com/jetta/360view/en/us/



I just need to be able to load 36 images to different frames and control the play head by dragging the mouse. Its a bit beyond me. I've found a couple tutorials, but they all use embedded .mov files. I want to just use .jpg.
Any ideas? the good tutorial I found a few years ago seems to have vanished, it had a camera that you were looking at, I think it was on flashkit.

Thanks for the help

Moving An Object Given Rotation Angle
just need the code templet for moving an object in the direction it is angled at(the rotation). I never learned how to do it but if someone game me the code it would really helpful?

3D Rotation Going Wrong When Object Is Not On Top-left
Hey

First time poster ^_^. A few google searches redirected me to this forum so I thought, why don't I register and ask here instead? Google hasn't been of much success...

Okay, take a look at this. I import an image and create a symbol out of it (it doesn't matter if my "registration point" (whatever that is) is on the top-left corner, or the center):



If I rotate it freely, I get the desired effect with the correct perspective:



Okay, but my symbol doesn't need to be there! I need it on the middle, so I just move it around like anybody would:



... and get it in the wrong perspective. WTF?

If I also try to move it using the translation tool, I get the same effect, and it fixes if I move it to the top-left corner again.

Any ideas on what's wrong here? any help is appreciated!

Thanks in advance

Setting Rotation Of Object Relevant To The Mouse
im trying to make the mc rotate corresponding with the _xmouse but its not Working i dunno why
i attached the file let me know if you anyone knows how to set it thanks

? Hold An Array Inside Another Object To Allow Rotation ?
Hi everybody,

I'm wondering how I can hold an array inside of a Sprite or, more ideally, inside a DisplayObject3D to allow for rotation of the whole array at once. (The array holds Plane objects).

When I try to add the Array to a DisplayObject3D, it throws an error, saying I'm trying to coerce the type of the Array to a DisplayObject3D. I just want to hold the Array in there.

Seems like a simple problem, I'm just a noob, ya know!

Thanks!

Brian

Rotation Problem With Object Facing Point
ok so heres the deal, I have this short little enterframe event that recalculates the rotation of my object based on the position of a point (simply put it is always facing that point)

The code works as intended and worked great until I tried to ease the rotation to look like the object is actualy "spinning" to face it's target, as soon as I did this I noticed a new problem, the spin is based on a 0-360 scale, so if the rotation needs to be 12 then it makes the rotation to be 12, the only problem is, say the rotation of the object is 350 and it needs to be 12, the object will spin all the way around to get back to 12, but in essence it should have rotated to 372 which is the more visually logical way of doing it,

Thus I come to my issue, I can't seem to get my head around how to calculate this properly so that it always goes to the closer rotation value.

I have tried a bunch of different solutions and searched all over the place and can't seem to find anything that works

here is my current code to calculate the roation of the objects:

The object I am rotating is the holder and the object it is facing is the target



ActionScript Code:
var angle = Math.atan2(target.y - holder.y, target.x - holder.x);
var radDeg:Number = 180 / Math.PI;
holder.rotation -= (holder.rotation - (angle*radDeg))*0.4;

I would be grateful if anyone has any insight on this subject or if you know of any documentation or tutorial anywhere that speaks to this sort of problem


thx

Copyright © 2005-08 www.BigResource.com, All rights reserved