Ask a Question related to Macromedia Director 3D, Design and Development.
-
Bukue #1
Interaction with a 3D Cube
I?m developing a webpage where it has to be a 3D cube, and each of its faces
has to point to a different URL. I have already constructed and shaded the
cube. I have also coded the part of the rotation of the cube. But I still not
find the part where the click on a certain face lead me to a specified URL.
I wrote this code in order to find the way to know wich face has been clicked:
************************************************** ******************************
************************************************** *
on mouseUp me
returnData = member("3D").camera[1].modelsUnderLoc(the mouseLoc,#detailed)
member("TXTcara").text = "You clicked on face " && returnData[1].faceID
end
************************************************** ******************************
*************************************************
where TXTcara is a textfield on the stage where I print which face has been
clicked
But it always says me that I clicked on face 1 or face 2. I mean a cube has 6
faces... and this code says that it has only two!!
How can I cerainly know wich face has been clicked??
The cube was constructed as a box.
Bukue Guest
-
recognize face of cube
hello! i'm just starting out in this 3D world. i've already managed to creat and understabd some models in 3d. What i have in mind is to creat a... -
Cube
Hi, I have just installed V 8.0 on XP and I have discovered some interesting functions related to cubes and crosstabs. Navigating on the site... -
cube surfaces
I would like to use images (jpeg) on each surface of a rotating cude.... Could anyone help me??? not sure where to start. i have coded a rotating... -
Damn Cube!
So freehand has developed an aversion to cubes. I was making them using the "Deconstruction FreeHand grapics: Part 1" tutorial method, which no... -
create 3d cube
Hello all! I'm really struggling with lingo! Would someone please tell me in simple terms/language how to create a 3d cube (preferably with... -
a?ex #2
Re: Interaction with a 3D Cube
the face is the polygon and not the face of the cube.
if you use the built-in modelresource than each face of the cube has a
seperate shader (look at the models shaderlist). I am pretty sure, you will
assign different shaders to the different clickable cube faces. so you will
need to get the shader which was clicked on.
this information is the #meshID of the picking data which is returned by the
picking functions (modelunderloc and modelunderray), if set to #detailed.
so in your case:
on mouseUp me
returnData = member("3D").camera[1].modelsUnderLoc(the mouseLoc,#detailed)
member("TXTcara").text = "You clicked on face " && returnData[1].meshID
end
I guess your snippet is a fast sample to point out the problem, but just in
case...you should check, if a model was hit in the first place and often the
above behavior is on the 3-D sprite and if you have only one camera you could
get away with all the hardcode (member name, camera index etc.) with:
on mouseUp me
sp = sprite(me.spritenum)
ml = the mouseLoc - point(sp.left, sp.top)
cam = sp.camera
returnData = cam.modelsUnderLoc(ml, #detailed)
if count(returnData) > 0 then member("TXTcara").text = "You clicked on face
" && returnData[1].meshID
end
a?ex Guest
-



Reply With Quote

