Ask a Question related to Macromedia Director 3D, Design and Development.
-
Jon Moyles #1
the angle from point A to point B (where the mouse is)
i'm trying to figure out the angle between a point in my sceane and the
point at which the mouse has been clicked. i've been looking at 3dD
world ([url]http://www.dmu.com/[/url]) but my maths skills arent strong enough to
figure it out from the starting point that gives me.
so i have something like:
mousePlace = the mouseLoc - point(sprite(1).left, sprite(1).top)
tRollOverModel = sprite(1).camera.modelUnderLoc(mousePlace)
if tRollOverModel <> 0 and _mouse.mouseDown then
targ = sprite(1).camera.spriteSpaceToWorldSpace(mousePlac e)
put "mouseover " & targ
end if
this tells me if ive clicked on the model and gives me "a" reading on
where the mouse is. i want to rotate a model to point at where the mouse
is.
any help would be much apreciated.
jon
Jon Moyles Guest
-
Getting a camera to point at one point
Hi, I've got a room where I can interpolate the camera to various models wihtin it by clicking on certain buttons. Once a button has been hit I... -
Add Point tool won't add point
I'm an Illustrator novice. I was tearing my hair out trying to get the add point tool to add a point to a path. It refused. I finally got it to work... -
Can someone point me to...
Could someone point me to where in the manuals (if it's in there...if not, just tell me) it describes the functions of the various file format... -
The best way to rotate point around other point ?
Hi, I need to rotate point in space around other point in space (not 0,0,0) and all three axis - different angles. Plz can you help me ? I will do... -
What's the point?
> Hmm, I think 'x' has the same visibility as 'fred'. Yes, I see now that it does. In Pascal's case, it wouldn't have, which is mainly what I... -
walfridson #2
Re: the angle from point A to point B (where the mouseis)
Check out pointat()
and if you need, anglebetween()
walfridson Guest
-
juroo #3
Re: the angle from point A to point B (where the mouseis)
so, time for a little math :)
A, B -> points
v = B-A ->vector from A to B
vx -> x axis
alpha -> angle between v and vx
v . vx
--------- = cos alpha
|v| . |vx|
juroo Guest
-
Jon Moyles #4
Re: the angle from point A to point B (where the mouse is)
thanks guys
i havent solved it yet though. i apologise for my ignorance.
heres whats going on. i have a pendulum hanging in my sceane, i want to
point the pendulum towards a mouse click (and then have it swing, the
swinging part works fine). pointing it at a mouse click is proving a lot
harder.
i want the pendulum to only move on one plane (it rotates on its x axis).
heres what i'm trying to do. i find the place where the user has clicked
(targ) i find the location of the fulcrum (fulcrumLoc) and i find the
location of the camera (cameraLoc). then i try to get the angle from the
fulcrumLoc to the point on the sightLine (targ - cameraLoc) on the yz
plane (where to turn the pendumlum to point at the mouse).
mousePlace = the mouseLoc - point(sprite(1).left, sprite(1).top)
cameraLoc = sprite(1).camera.worldPosition
fulcrumLoc = member("pendulum04").model("fulcrum01").worldPosit ion
targ = sprite(1).camera.spriteSpaceToWorldSpace(mousePlac e)
sightLine = targ - cameraLoc
pendulumAngle =
member("pendulum04").model("fulcrum01").transform. position.angleBetween(sightLine)
as you can see i dont know what i'm doing. for one thing i dont know how
to work on a point in the yz plane. for another
transform.position.angleBetween is throwing a "method not found" error.
So i still need help. I apreciate the efforts already made and would
really like it if somebody can explain what i'm doing wrong.
thanks
jon
Jon Moyles Guest



Reply With Quote

