It is currently Thu Sep 02, 2010 2:47 pm




Post new topic Reply to topic  [ 7 posts ] 
 primitive plane setup 
Author Message

Joined: Sun Aug 30, 2009 6:31 pm
Posts: 65
Post primitive plane setup
With my first post I need help setting up a plane. I have downloaded the latest Papervision files from Google and I am using Flash CS3. I want to set up my plane so it is pitched from the horizontal about 30 degrees or an isometric view of a plane. Most of the planes I have seen in tutorials are vertical. How do you set the plane so it is horizontal?


Sun Aug 30, 2009 6:55 pm
Profile

Joined: Sat Aug 29, 2009 10:30 am
Posts: 2
Post Re: primitive plane setup
Plane has properties x, y, z and rotationX, rotationY, rortationZ.
Also you can use method - yaw();


Mon Aug 31, 2009 2:35 pm
Profile

Joined: Sun Aug 30, 2009 6:31 pm
Posts: 65
Post Re: primitive plane setup
I am trying to set some buttons with rotation, pitch and yaw functions but when I click the button nothing happens. Do these need to be in a onEnterFrame event or something?

Code:
  1.  
  2. var plane:Plane = new Plane(mm, 400, 400, 10, 10);
  3. scene.addChild(plane);
  4.  
  5. //plane.pitch(70);
  6. //plane.roll(0);
  7. //plane.yaw(0);
  8.  
  9. // render the plane
  10. renderer.renderScene(scene, camera, viewport);
  11.  
  12. //button controls
  13. rotateX_btn.addEventListener(MouseEvent.CLICK, rotateAboutX, false, 0, true);
  14. rotateY_btn.addEventListener(MouseEvent.CLICK, rotateAboutY, false, 0, true);
  15. rotateZ_btn.addEventListener(MouseEvent.CLICK, rotateAboutZ, false, 0, true);
  16. pitch_btn.addEventListener(MouseEvent.CLICK, pitchUp, false, 0, true);
  17. roll_btn.addEventListener(MouseEvent.CLICK, rollLeft, false, 0, true);
  18. yaw_btn.addEventListener(MouseEvent.CLICK, yawY, false, 0, true);
  19.  
  20.  
  21. function rotateAboutX(evt:MouseEvent):void{
  22.     plane.rotationX += 20; 
  23. };
  24.  
  25. function rotateAboutY(evt:MouseEvent):void{
  26.     plane.rotationY -= 20; 
  27. };
  28.  
  29. function rotateAboutZ(evt:MouseEvent):void{
  30.     plane.rotationZ -= 20; 
  31. };
  32.  
  33. function pitchUp(evt:MouseEvent):void{
  34.     plane.pitch(20);   
  35. };
  36.  
  37. function rollLeft(evt:MouseEvent):void{
  38.     plane.roll(20); 
  39. };
  40.  
  41. function yawY(evt:MouseEvent):void{
  42.     plane.yaw(20); 
  43. };
  44.  
  45.  
  46.  


Wed Sep 09, 2009 6:38 pm
Profile

Joined: Sun Aug 30, 2009 6:31 pm
Posts: 65
Post Re: primitive plane setup
I managed to get a material to map to a plane and I created buttons which let me control the pitch, yaw and roll and those are working correctly now. But I need a little more interactivity. First how do I change the material from one kind to another? Suppose I have two buttons each represent a different material. If I click on one how do I tell papervision to switch the material?


Thu Sep 10, 2009 11:13 pm
Profile

Joined: Sun Aug 30, 2009 6:31 pm
Posts: 65
Post Re: primitive plane setup
I think I figured out how to switch materials. I now have another issue. I have a room image that I want to place over top of my papervision. In my flash movie the room is in the top layer but the scene appears over top of it.

Is there away to put the 3d scene or the room above?


Attachments:
screen1.jpg
screen1.jpg [ 11.06 KiB | Viewed 364 times ]
Fri Sep 11, 2009 1:08 pm
Profile
Forum Administrator

Joined: Sat Mar 07, 2009 9:59 pm
Posts: 1107
Post Re: primitive plane setup
if you put your flash stuff before you setup/init your PV scene it will appear behind. If you do it after then it will be in front. Or use addchildAt()


Fri Sep 11, 2009 3:18 pm
Profile

Joined: Sun Aug 30, 2009 6:31 pm
Posts: 65
Post Re: primitive plane setup
I don't understand. The room image is a movieClip I took from the library and I placed it on the stage. Is this not the correct way to do this?


Fri Sep 11, 2009 3:24 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.