Learning Papervision 3d
Hey, i've only been on this forum a little while, but i've seen several posts about papervision. I've never heard of it until exploring this forum and it looks down right awesome. One thing I just can't seem to find is where to get started with it. I can't seem to find any documentation or learning material. If anyone has some links to point me in the right direction to get started would be great.-Jrock
General Flash
Posted on: Fri Jul 18, 2008 11:09 pm
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Learning Flash And Papervision
Whats the best way to learn Flash and Papervision3D?
I'm pretty new to the flash scene and I saw some of the things that papervision3D could do and I liked it. I have some knowledge of as3 and the classes and stuff like that.
Well, my question is how did you learn papervision and Flash?
Papervision 2.0
Any ideas how how this was created?
http://www.fat-man-collective.com/
I learned the basics so far, yet i'm still new to actionscripting. The main thing i'm trying to understand is the placing of the movieclips, and letting the viewer drag with a mouse to change the camera position.
Papervision Help
I been toying with papervision on and off for the past month and i've made some progress. The last thing i'm trying to figure out is panning the camera per viewers mouse movement. Something like this, but instead of shifting the plane in this example, I want the camera to hover around. I'm not sure if this requires the hover method.
http://www.dehash.com/?page_id=151
Below is a basic setup with a single plane. In the loop function, what do I formula do I add to make the camera hover? After I figure this out, i'll be set for a while.
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.objects.special.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.materials.shaders.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.lights.*;
import org.papervision3d.render.*;
import org.papervision3d.view.*;
import org.papervision3d.events.*;
import org.papervision3d.core.utils.*;
import org.papervision3d.core.utils.virtualmouse.VirtualM ouse;
import caurina.transitions.Tweener;
var viewport:Viewport3D = new Viewport3D(0, 0, true, true);
addChild(viewport);
var renderer:BasicRenderEngine = new BasicRenderEngine();
var scene:Scene3D = new Scene3D();
var camera:Camera3D = new Camera3D();
camera.zoom = 11;
camera.focus = 100;
var mam:MovieMaterial = new MovieMaterial(face);
mam.interactive = true;
mam.smooth = true;
mam.animated = true;
mam.doubleSided = true;
var plane:Plane = new Plane(mam, 337, 501, 6, 6); //texture, width, height, num of poly's...
scene.addChild(plane);
var planeRotation= plane.rotationY;
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
//camera.hover??
renderer.renderScene(scene, camera, viewport);
}
Papervision 2.0 Help
I downloaded [ http://www.rockonflash.com/papervisi...hPhongDemo.fla ] and opened it in Flash. Then I got the error:
Vertices3D.as, Line 195
1000: Ambiguous reference to Vertex3D.
What's wrong? :O It SHOULD work when it is downloaded.
I have also problems with my own project. When I try to run that, I get this:
MovieScene3D.as, Line 129
1020: Method marked override must override another method.
The problems seems to be in the PaperVision files. But how?
It can't be errors in them, so how do I fix this? Please help! It's very important!
Papervision Help
I'm trying to make a cube and put 4 different bitmaps (in the library) on the side. I've seen a couple tutorials on the web that do this. I;ve doneloaded a few of them and they don't work. Here is what I have so far...it doesn't work either.
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import flash.events.MouseEvent;
//sprite
var container:Sprite = new Sprite();
container.x = stage.stageWidth * 0.5;
container.y = stage.stageHeight * 0.5;
addChild(container);
//scene
var scene:Scene3D = new Scene3D(container);
//camera
var camera:Camera3D = new Camera3D();
camera.x=3000;
camera.y=-300;
camera.zoom=10;
camera.focus=100;
var ML:MaterialsList = new MaterialsList(
{
front: new BitmapAssetMaterial("p1"),
back: new BitmapAssetMaterial("p2"),
right: new BitmapAssetMaterial("p3"),
left: new BitmapAssetMaterial("p4"),
top: new BitmapAssetMaterial("p4"),
bottom: new BitmapAssetMaterial("p4")
}
);
//create cube
//var cube1:Cube = new Cube(ML, 400, 400, 400, 9, 9, 9);
//add to scene
//scene.addChild(cube1);
scene.renderCamera(camera);
Papervision 2.
Hey,
well i downloaded a script for coverFlow, but it think something is wrong in the code, it uses papervision 2, and tweener.
Here is the code:
Code:
/**************************************
title: CoverFlow knockoff
author: John Dyer (http://johndyer.name)
license: MIT
updated: 12/12/2007
*************************************/
package
{
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.filters.*;
import flash.net.*;
import flash.geom.*;
import flash.system.LoaderContext;
import flash.text.*;
import org.papervision3d.cameras.*;
import org.papervision3d.scenes.*;
import org.papervision3d.objects.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.events.*;
import org.papervision3d.core.proto.*;
import org.papervision3d.core.*;
import caurina.transitions.Tweener;
import flash.ui.Keyboard;
import CoverFlowEvent;
public class CoverFlow extends EventDispatcher
{
var showReflections:Boolean = true;
var planes:Array = [];
var reflectedPlanes:Array = [];
var tweens:Array = [];
var reflectedTweens:Array = [];
var currentPlaneIndex:Number = 0;
var planeAngle:Number = 65;
var planeSeparation:Number = 65;
var planeOffset:Number = 60;
var selectPlaneZ:Number = -180;
var tweenTime:Number = 0.8;
var planeWidth = 265;
var planeHeight = 200;
var transition:String = "easeOutExpo"; //"easeOutSine";
var stage:Stage;
var camera:Camera3D;
var scene:Scene3D;
var coverFlowData:Array;
var textTitle:TextField = null;
public var needsRender:Boolean = true;
public function CoverFlow(stage:Stage, camera:Camera3D, scene:Scene3D, coverFlowData:Array=null, showReflections:Boolean=true, planeWidth:Number=265, planeHeight:Number=200)
{
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener( MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
this.stage = stage;
this.scene = scene;
this.camera = camera;
this.coverFlowData = coverFlowData;
this.showReflections = showReflections;
this.planeWidth = planeWidth;
this.planeHeight = planeHeight;
textTitle = new TextField();
textTitle.autoSize = TextFieldAutoSize.CENTER;
var textStyle:TextFormat = new TextFormat("Arial", 12, 0xffffff);
textStyle.align = "center";
textTitle.defaultTextFormat = textStyle;
stage.addChild(textTitle);
textTitle.y = 8;
textTitle.x = 700/2;
if (coverFlowData != null)
loadData();
}
var currentIndex:Number = 0;
public function loadData(coverFlowData:Array=null) {
if (coverFlowData != null)
this.coverFlowData = coverFlowData;
currentIndex = 0;
loadNextPlane();
}
private function loadNextPlane() {
textTitle.text = "Loading images ... " + (currentIndex+1) + " of " + coverFlowData.length;
var loaderContext:LoaderContext = new LoaderContext ();
loaderContext.checkPolicyFile = true;
var imageLoader:Loader = new Loader();
imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, imageLoaded );
imageLoader.load( new URLRequest( coverFlowData[currentIndex].imageUrl ), loaderContext );
}
function imageLoaded (e : Event ) : void {
var plane:Plane = null;
var loadedBmp : Bitmap = e.target.content as Bitmap;
var bmp : BitmapData = loadedBmp.bitmapData;
var newWidth:Number = planeWidth;
var newHeight:Number = planeHeight;
if (bmp.width > bmp.height) {
newWidth = planeWidth;
newHeight = bmp.height/bmp.width *planeWidth;
} else {
newWidth = bmp.width/bmp.height * planeHeight;
newHeight = planeHeight;
}
var planeMaterial:BitmapMaterial = null;
if (showReflections) {
var bmpWithReflection:BitmapData = new BitmapData(bmp.width, bmp.height*2, false, 0);
// draw a copy of the image
bmpWithReflection.draw(bmp);
// draw the reflection, flipped
var alpha:Number = 0.3;
var flipMatrix:Matrix = new Matrix(1, 0, 0, -1, 0, bmp.height*2 + 4);
bmpWithReflection.draw( bmp, flipMatrix, new ColorTransform(alpha, alpha, alpha, 1, 0, 0, 0, 0) );
// Fade
var holder:Shape = new Shape();
var gradientMatrix:Matrix = new Matrix();
gradientMatrix.createGradientBox( bmp.width, bmp.height, Math.PI/2 );
holder.graphics.beginGradientFill( GradientType.LINEAR, [ 0, 0 ], [ 0, 100 ], [ 0, 0xFF ], gradientMatrix)
holder.graphics.drawRect(0, 0, bmp.width, bmp.height);
holder.graphics.endFill();
var m:Matrix = new Matrix();
m.translate(0, bmp.height);
bmpWithReflection.draw( holder, m );
planeMaterial = new BitmapMaterial(bmpWithReflection);
planeMaterial.smooth = false;
planeMaterial.interactive = true;
plane = new Plane( planeMaterial, newWidth, newHeight*2, 4, 4);
plane.y = -planeHeight/2;
} else {
planeMaterial = new BitmapMaterial(bmp);
planeMaterial.smooth= true;
plane = new Plane( planeMaterial, newWidth, newHeight, 4, 4);
}
// stack the images
plane.z = (currentIndex+1 < coverFlowData.length/2) ?
(coverFlowData.length/2-currentIndex)*10 :
-(currentIndex - coverFlowData.length/2) * 10;
trace(currentIndex + ": " + plane.z);
// delete the loaded iamge
bmp.dispose();
plane.extra = {planeIndex : currentIndex, height: newHeight};
scene.addChild(plane);
planes.push(plane);
plane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, planeClicked);
if (currentIndex < coverFlowData.length-1) {
currentIndex++
loadNextPlane();
} else {
camera.lookAt( new DisplayObject3D() );
shiftToItem(5);
}
}
private function goToLink() {
var request:URLRequest = new URLRequest( coverFlowData[currentPlaneIndex].clickUrl );
navigateToURL(request, "_blank");
}
private function planeClicked(e:InteractiveScene3DEvent) {
var index:Number = e.displayObject3D.extra.planeIndex;
trace(index);
// don't click on the reflection
if (!showReflections || e.y <= e.displayObject3D.extra.height ) {
if (index == currentPlaneIndex) {
goToLink();
} else {
shiftToItem(index);
}
}
}
private function keyDownHandler(ev:KeyboardEvent) {
switch (ev.keyCode) {
case Keyboard.LEFT:
moveLeft();
break;
case Keyboard.RIGHT:
moveRight();
break;
case Keyboard.UP:
case Keyboard.PAGE_UP:
shiftToItem(0);
break;
case Keyboard.DOWN:
case Keyboard.PAGE_DOWN:
shiftToItem(planes.length-1);
break;
case Keyboard.ENTER:
goToLink();
break;
}
}
private function mouseWheelHandler( event :MouseEvent ):void
{
if (event.delta < 0)
moveRight();
else
moveLeft();
}
public function moveLeft() {
if (currentPlaneIndex > 0) {
shiftToItem(currentPlaneIndex-1);
}
}
public function moveRight() {
if (currentPlaneIndex < planes.length -1) {
shiftToItem(currentPlaneIndex+1);
}
}
public function shiftToItem(newCenterPlaneIndex) {
needsRender = true;
if (currentPlaneIndex == newCenterPlaneIndex)
return;
for (var i:Number=0; i<planes.length; i++) {
var plane:Plane = planes[i] as Plane;
// smoothing only the main one or the one immediately left or right
if (i >= newCenterPlaneIndex-1 && i <= newCenterPlaneIndex+1) {
plane.material.smooth = true;
} else {
plane.material.smooth = false;
}
if (i == newCenterPlaneIndex) {
tweens[i] = Tweener.addTween(plane,
{x: 0,
z: selectPlaneZ,
rotationY: 0,
time:tweenTime,
transition:transition,
onComplete: function() { needsRender = false; } });
// all the ones to the left
} else if (i < newCenterPlaneIndex) {
tweens[i] = Tweener.addTween(plane,
{x: (newCenterPlaneIndex - i+1) * -planeSeparation - planeOffset,
z: 0,
rotationY: -planeAngle,
time:tweenTime,
transition:transition});
// all the ones to the right
} else {
tweens[i] = Tweener.addTween(plane,
{x: ((i-newCenterPlaneIndex+1) * planeSeparation) + planeOffset,
z: 0,
rotationY: planeAngle,
time:tweenTime,
transition:transition});
}
}
currentPlaneIndex = newCenterPlaneIndex;
textTitle.text = coverFlowData[currentPlaneIndex].title;
dispatchEvent(new CoverFlowEvent(CoverFlowEvent.ITEM_FOCUS, newCenterPlaneIndex));
}
}
}
If you want to see the full thing look at:
http://johndyer.name/?tag=/papervision
Chris
Papervision 3D 2.0
Hi there i am new to the classes of actionscript 3.0 and it is something i would like to learn how to use. i found a tutorial for using papervision3d 2.0 however i am unsure how to download the classes off of google code and the tutorial presumes you already know how to do it. any advice you can give will be very greatly appreciated.
Thankyou in advance.
Darren Rutter.
Papervision
Hi,
ive got a problem with papervision 2.0..
i get an error in the TriangleMaterial.as file it says:
1020:Method marked override must override another method.
the as file states:
package org.papervision3d.core.material
{
/**
* @Author Ralph Hauwert
*/
import flash.display.BitmapData;
import flash.display.Graphics;
import flash.geom.Matrix;
import org.papervision3d.core.geom.renderables.Triangle3D ;
import org.papervision3d.core.proto.MaterialObject3D;
import org.papervision3d.core.render.data.RenderSessionDa ta;
import org.papervision3d.core.render.draw.ITriangleDrawer ;
public class TriangleMaterial extends MaterialObject3D implements ITriangleDrawer
{
public function TriangleMaterial()
{
super();
}
override public function drawTriangle(face3D:Triangle3D, graphics:Graphics, renderSessionData:RenderSessionData, altBitmap:BitmapData = null, altUV:Matrix = null):void
{
}
}
}
thnx
Papervision Help?
i have a plane 250x250 on which i load an image 100x100 using the loader class,the problem is the image gets stretched on the whole plane...
is there any way to have the image loaded with it's right dimensions?
Help With Papervision
I've just been tinkering with it a bit and would like to know if their is some sort of setting to have like a child of a Plane so if the parent moves, the child does also? Here is a link to what I have now:
http://ronnieswietek.com/hosted/as3tree/tree.swf
I am going for a diorama look and want it to look as if that wood in the back is holding the tree up. The problem is the way it is rotating is not working. Here is my code:
ActionScript Code:
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
import org.papervision3d.materials.BitmapFileMaterial;
var viewport:Viewport3D;
var scene:Scene3D;
var camera:Camera3D;
var tree:Plane;
var stand:Plane;
var renderer:BasicRenderEngine;
init3D();
createPlane();
addEventListeners();
function init3D():void
{
// VIEWPORT
viewport = new Viewport3D(0, 0, true, false);
addChild(viewport);
//
// RENDERER
renderer = new BasicRenderEngine();
//
// SCENE
scene = new Scene3D();
//
// CAMERA
camera = new Camera3D();
camera.zoom = 11;
camera.focus = 100;
}
function createPlane():void
{
BitmapFileMaterial.LOADING_COLOR = 0x0000FF;
BitmapFileMaterial.ERROR_COLOR = 0xFF0000;
//
var treeMaterial:BitmapFileMaterial = new BitmapFileMaterial("tree-side-1.png");
var standMaterial:BitmapFileMaterial = new BitmapFileMaterial("wood.png");
treeMaterial.doubleSided = true;
standMaterial.doubleSided = true;
//
tree = new Plane(treeMaterial, 191, 175, 5, 5 );
stand = new Plane(standMaterial, 23, 80, 5, 5 );
//
scene.addChild(stand);
scene.addChild(tree);
stand.x = 30;
stand.y = -60;
stand.z = 0;
stand.rotationX = -45;
}
function addEventListeners():void
{
addEventListener(Event.ENTER_FRAME, __onEnterFrame);
}
function removeEventListeners():void
{
removeEventListener(Event.ENTER_FRAME, __onEnterFrame);
}
function __onEnterFrame(e:Event):void
{
tree.rotationY = viewport.mouseX / 2;
stand.rotationY = viewport.mouseX / 2;
renderer.renderScene(scene, camera, viewport);
}
Papervision Help
I been toying with papervision on and off for the past month and i've made some progress. The last thing i'm trying to figure out is panning the camera per viewers mouse movement. Something like this, but instead of shifting the plane in this example, I want the camera to hover around. I'm not sure if this requires the hover method.
http://www.dehash.com/?page_id=151
Below is a basic setup with a single plane. In the loop function, what do I formula do I add to make the camera hover? After I figure this out, i'll be set for a while.
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.objects.special.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.materials.shaders.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.lights.*;
import org.papervision3d.render.*;
import org.papervision3d.view.*;
import org.papervision3d.events.*;
import org.papervision3d.core.utils.*;
import org.papervision3d.core.utils.virtualmouse.VirtualM ouse;
import caurina.transitions.Tweener;
var viewport:Viewport3D = new Viewport3D(0, 0, true, true);
addChild(viewport);
var renderer:BasicRenderEngine = new BasicRenderEngine();
var scene:Scene3D = new Scene3D();
var camera:Camera3D = new Camera3D();
camera.zoom = 11;
camera.focus = 100;
var mam:MovieMaterial = new MovieMaterial(face);
mam.interactive = true;
mam.smooth = true;
mam.animated = true;
mam.doubleSided = true;
var plane:Plane = new Plane(mam, 337, 501, 6, 6); //texture, width, height, num of poly's...
scene.addChild(plane);
var planeRotation= plane.rotationY;
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
//camera.hover??
renderer.renderScene(scene, camera, viewport);
}
Help With Papervision
Hi
I have movieclip which is 1024w 768 h and I'm adding it to the stage throught papervision.
So i place the Movieclip into a movieAssetMaterial and apply that material to plane object then add it to the stage with the proper properties. Well it adds the plane to the stage just fine but it's alot smaller even though I have the planes height and width to match my movieclips? I need help to on to figure why it's shrinking down my movieclip. Thanks
PaperVision 1.9
Hi all,
I have been scouring the net for an example of...
How to give interactivity to a button within a MovieAssetMaterial on a cube face using Papervision 1.9 (Phunky Branch). If anyone knows of a good example or can help me that would be amazing. I just want to add MOUSE_OVER and MOUSE_UP events. Thanks!
Papervision 2.0?
Over the weekend I played with AS3 for the first time, and I feel I may as well play with PV3D for the first time too
I've heard Papervision 2.0 mentioned, though strangely, when I go to the actual papervision google code page, there is no papervision 2.0, only 1.5 :S
Where can one procure Papervision 2.0? And is advisable to try this as a Papervision noob? Or stick with 1.5 to start?
Cheers,
Joe
Is Anyone Using Papervision?
Has anyone on these forums worked with papervision at all? I have a client wanting me to create a website for them using some of the capabilities of papervision. This is the first I'd heard of papervision, but have since started looking into it and learning a little bit about it. It seems to be a bit over my head, but I want to take on the project and do whatever I can to get it done, even if it means finding someone else who is more technically savvy than me to help me complete this project.... wondering if anyone on these boards has any experience with papervision.. Do you have any idea if it is something that someone who is not an AS master, but rather more of an intermediate user can manage?
Just wondering if there is anyone out there who is using this technology, and has any words of wisdom before I decide whether or not to take on this project...Also, I am still running Flash 8. Is it much harder to use it with AS2 than AS3?
Thanks!
Elliott
Papervision AS2 Help
Hi, I'm knew to the forum and was wondering if anyone could point me in the right direction. Essentially I am looking for a detailed tutorial on using Papervision for AS2, something that will explain what each property and element does. I have been to the Papervision website and gotoAndLearn(), and neither have any information on the AS2 version of Papervision. Any help would be greatly appreciated.
Thanks,
-mdelguidice-
Papervision Vs. CS4 3D
Hi! I'm trying to build a spinning cube with the built-in cs4 AS3 3D features, and facing a simple z-sorting problem without getting any answer. So I'm thinking it's not so simple.
So, in the end, what do you think about new features? Provided that I only do simple things, not 3D modeling at all, from an AS3 point of view, or perspective (yes, I'm playing wiith words ) should I continue using Papervision? Isn't it a little smarter? What is better?
AS3 - Papervision IE Bug?
im making a flash thing for my myspace, in my spare time..and i came across this issue..
http://www.myspace.com/millerinabottle
if you look in firefox, it looks fine, same with the standalone flash player. but look at it in ie.. it seems like the registration point is way off.. any thoughts? im confused
Papervision 3d?
I'm fairly new at this so I was just wondering if papervision3d requires flex to use or if I can use it with actionscript 2.0 in flash 8 or cs3?
Papervision Help
Hey, so i'm setting up a papervision project, and pulling the images through xml and for loop. How ever I cant quite figure out how to target my images once they have been loaded. The loop and xml work the way they should, but can I then control each image independently? And then it it common practice to call renderer.renderScene(scene, camera, viewport); in a ENTER_FRAME? Thanks for any help.
Here what I have so far. Stopped to figure out why I cant target! Thanks!
Code:
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.objects.special.*;
import org.papervision3d.objects.primitives.*;
import org.papervision3d.materials.*;
import org.papervision3d.materials.special.*;
import org.papervision3d.materials.shaders.*;
import org.papervision3d.materials.utils.*;
import org.papervision3d.lights.*;
import org.papervision3d.render.*;
import org.papervision3d.view.*;
import org.papervision3d.events.*;
import org.papervision3d.core.utils.*;
import org.papervision3d.core.utils.virtualmouse.VirtualMouse;
var xml:XML;
var xmlList:XMLList;
var plane:Plane;
var scene:Scene3D;
var camera:Camera3D;
var viewport:Viewport3D;
var renderer:BasicRenderEngine;
var face2:Face;
var mat:BitmapFileMaterial;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("paper.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
function xmlLoaded(event:Event):void
{
xml = XML(xmlLoader.data); //new xml
xmlList = xml.children(); //xml to xmlList
viewport = new Viewport3D(0/*width*/ ,0 /*height*/ ,true /*autoscale*/ ,true/*interactive*/)
viewport.buttonMode = true; //adds handCursor
addChild(viewport); //container for 3d scene
renderer = new BasicRenderEngine(); //creates renderer for scene
scene = new Scene3D(); //creates new scene
camera = new Camera3D();//creates new cmaera
camera.zoom = 8;
camera.focus = 100;
for(var i:uint = 0; i < xmlList.images.*.length(); i++)
{
face2 = new Face();
mat = new BitmapFileMaterial(xmlList.images.image[i]);
mat.interactive = true // is interactive
mat.smooth = true //antialias material
mat.doubleSided = true;
plane = new Plane(mat, /*material*/ 150, /*width*/ 150, /*depth*/10,/*triangles*/ 10) ; /*triangles*/
plane.x = i*160
plane.y = 0
plane.z = 0
scene.addChild(plane); //adds object to scene
addEventListener(MouseEvent.CLICK, getInfo);
}
renderer.renderScene(scene, camera, viewport); // scene, camera, viewport
}
function getInfo(event:MouseEvent):void //used to get info, and render screen
{
renderer.renderScene(scene, camera, viewport); // updates scene, camera, viewport
//if(event.keyCode == 32)
/*trace("name: " + event.target.name)
trace("id: " + event.target.id)
trace("extra: " + event.target.extra)
trace("faces: " + event.target.faces)
trace("material: " + event.target.material)
trace("materials: " + event.target.materials)
trace("parent: " + event.target.parent)
trace("rotationX: " + event.target.rotationX)
trace("rotationY: " + event.target.rotationY)
trace("rotationZ: " + event.target.rotationZ)
trace("x: " + event.target.x)
trace("y: " + event.target.y)
trace("z: " + event.target.z)
trace("view Matrix 3D: " + event.target.view)*/
}
oh and sidenote, this bottom function I was using to try and figure out all the properties, so It's just a function containing all traces)
Papervision 3D Help
I have recently installed Papervision 3D and am now following some tutorials to see how to use it.
I keep having a problem that says;
"Warning: 5004: The file 'playerglobal.swc', which is required for typechecking ActionScript 3.0, could not be found. Please make sure the directory '$(AppConfig)/ActionScript 3.0/Classes' is listed in the global classpath of the ActionScript 3.0 Preferences."
Please help!
Papervision API ?
Where can I get the Papervison classes?I don't have a clue how to use Subversion.
Papervision 2.0
Hi All
Im just trying to get to grips with papervision 1.5 but ive been following a tutorial on how to make an interactive cube and have just realised that it used papervision 2.0. How can i get a hold of this new papervision? Ive been to google code and looked at the folders for the great white but it goes quite deep.
I'm probably being dumb but how do I update my papervision?
Thanks
Papervision Depths Help
http://www.rarhost.com/download-lx4v5d.html
Download and watch the stone cylinders. Drive towards them and watch what happens. (use the arrow buttons)
When the camera is far away from the cylinders, they are underneath the ground, but they shouldn't be!
How do I fix this? Please help!
Papervision On Top Of Everthing Else
I created some cubes using papervision and made them interactive with InteractiveMovieMaterial. All the interactions and mouse events are fine but when the cubes are overlapping with normal movieclips on the stage, the mouse event can't reach normal buttons/movieclips. Even though normal movieclips look like on top of the cubes but the mouse can't reach them. Please help. Thanks!
Papervision 3D And WOW 3D Physics
Hello everyone,
I am trying to use the WOW engine and render it with Papervision 3D. Does anyone have a sample code of how can I do this?
I saw the tutorials of WOW engine but there they dont make the connection with Papervision.
http://seraf.mediabox.fr/wow-engine/...ne-wow-engine/
I will appreciate if someone can explain me how to connect the two engines in order to view 3D with physics.
Thanks,
Panos
Papervision 2, GreatWhite
Does anyone know how to fix the bug in papervision were you can't click sometimes, or it clicks the wrong object?
Here is the open source code:
http://johndyer.name/post/2007/11/Ye...pervision.aspx
I want it to work, i tried to repair it but i can't quite put my finger on it.
Anyone?
Papervision Distortion
I'm having a big problem with objects perspectives being distorted in papervision. If I place an 3d object, in this case a cube, any where except dead in front of the camera it seems to increase the depth of the cube. The further from the camera the worse it gets. See the attached image for a better explanation.
I'm obviously missing something very basic here but I just can't figure it out.
Any suggestions would be most appreciated.
Thoughts On Papervision 3D
Thought i'd get some opinions on papervision 3D. I'd be curious to know if it's demanding from a production standpoint or if there are drawbacks in proposing this to the creative team. The visual effect of moving through environments is really cool and I've seen some soft surface modeling is possible:
http://www.blog.lessrain.com/?p=538
Papervision Menu
Hi guys, I am a newbie to this forum (but not to actionscript) and I'm looking for some advice....
I currently have a project underway involving Papervision but I guess that an aside as the problem doesnt necessarily involve it. My problem is this: I have a 3D rotating menu that controls an iFrame, when the user clicks on the menu item, the menu spins into position and displays the correct content in the iFrame, pretty simple, but quite effective and it is viewable here http://grayscale.wintertwilight.co.uk.
The problem comes when the user hits the back button, the iFrame reloads but the menu obviously stays in the same position. I would like to be able to rotate the menu back to the correct position when the back button is pressed. I know that flash can communicate with the back button using frame labels, but this menu is code driven so is only on one frame.
Does anyone know if it is possible to get flash to constantly poll an HTML page looking for a variable within it that will allow me to trigger a function within flash?
Any advice would be much appreciated!
Cheers and I hope I can be of some help on this forum in the future!
Papervision 3D 2.0 Rendering
Hey, ive just started with Papervisions branch GreatWhite.
My question is how I shall do to render a new layer over another 3dworld.
The basic world is a simple cube.
The new layer will contain clickable planes.
Thanks.
Spinning In Papervision
I'm playing around with papervision. When I create an object, for example a sphere and the use sphere.yaw to spin it around, it is consistently leaving the original where it is: ie spinning but leaving a copy. Can anyone explain this?
Papervision Tutorial
I found a tutorial a while ago that showed you how to create similiar sort of physics (but on a must simpler basis) to Absolut World.
But then I got a corrupt HD and lost my bookmarks and cant remember what I belovedly googled to find it
Anyone know of a site like the above?
Cheers
Papervision Hit Test
Hi all
made a little thing in Papervision where you can move a cube around and collect other cubes - I've used hitTestPoint to collect items and it works fine.
I set up and plane as the ground and 4 more as the walls and I can't work out how to detect when the cube I am controlling hits the walls. As soon as I run the move the hit test returns true even though my cube is nowhere near the walls. I've tried hitTestObject and hitTestPoint. Are there issues with running hit tests on planes because they are flat?
I've attached the working files. The problematic code is commented out in the processFrame function. If someone could point me in the right direction it would be greatly appreciated.
Thanks
PS is there an online reference for Papervision 2 that includes examples like the built in flash help?
Papervision Practice
Tried using a cool transition effect in 3d. I think it came out well.
http://<br />
http://blog.kreativek...-effect-in-3d/
Also I'd like to know how to make it clickable? I tried the interactive scene3d but it dosent work, I think its because of the way the elements are added to the stage. Any ideas?
Slow Papervision
Im just curious how come when i make a plane in papervision thats too large, Flash framerates slow down to a crawl, but here must be 100's of planes that run so smoothly?
http://animasinteractive.com/propaga...aradoxKitchen/
Am i missing something? Any help would be great!
[Papervision] Mask
Hello,
I have several 3d elements inside of my Scene3D object (text, images and simple shapes). The height is too big so I'd like to be able to scroll these 3d elements but I don't know how to hide a part of a 3d element like in 2d when a Sprite hide another Sprite when the 1st one is defined as mask.
Thanks for your help.
PaperVision & SketchUp
Hi all,
I am trying to re-build the this source (working example).
The transformed code is the following:
Code:
package
{
import flash.display.*;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.objects.parsers.Sketchup;
import org.papervision3d.objects.parsers.SketchupCollada;
import org.papervision3d.scenes.Scene3D;
public class Sketch extends PaperBase
{
public var model:Sketchup;
public function Sketch()
{
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.quality = StageQuality.MEDIUM;
init();
}
override protected function init3d():void
{
model = new Sketchup("BOX.kmz");
model.scale = .01;
default_scene.addChild( model );
}
override protected function processFrame():void
{
model.rotationY += (((mouseX - (stage.stageWidth/2))/10) - model.rotationY) / 3;
model.rotationX += ((-((mouseY-(stage.stageHeight/2))/10))-model.rotationX) / 3;
}
}
}
It compiles without any erros - but the problem is - whereas
the original working example shows the textures - I only get
a wireframe model ?
Does anyone know what I am doing wrong here ?
Btw. My class inherits the PaperBase-Class.
Thanks in advance,
benny!
Papervision, Tweener Help
Hi, I have a problem that i'm confused by:
I have a simple plane called grassPlane, and in actions I've wrote down:
Tweener.addTween(grassPlane, {x:700, time:8});
This works all fine and dandy by itself, but I want it so that when I click the plane it carries out that action. I've now got:
grassPlane.addEventListener(MouseEvent.CLICK,butto nPressed);
function buttonPressed(e:MouseEvent) {
Tweener.addTween(grassPlane, {x:700, time:8});
}
but this doesn't work, so what have I done wrong? Give us some help please
AS3 And Papervision Problems
Hello
i am learning AS3 through papervision3D and I am calling for some help with my script. For those who know Papervision3D, it would be very helpful to get your help.
i have a simple movieclip in a flash file called "mcContainer.fla" It has a Mouse Over state.
i want to bring my movieclip in my papervision flash file called containerPanorama.fla which calls my class containerPanorama. I have a bunch of problem that i don't know how to solve. I have searched on this forum, but I am still having a hard time to figure it out.
this is my containerPanorama.as:
ActionScript Code:
import flash.display.*;
import flash.events.MouseEvent;
import flash.net.URLRequest;
import org.papervision3d.core.proto.CameraObject3D;
import org.papervision3d.materials.MovieMaterial;
import org.papervision3d.materials.utils.*;
import org.papervision3d.objects.*;
import org.papervision3d.events.InteractiveScene3DEvent;
import org.papervision3d.view.Viewport3D; // We need a viewport
import org.papervision3d.cameras.*; // Import all types of camera
import org.papervision3d.scenes.Scene3D; // We'll need at least one scene
import org.papervision3d.render.BasicRenderEngine; // And we need a renderer
public class containerPanorama extends Sprite { //Must be "extends Sprite"
public var mcContainer:URLRequest = new URLRequest("mcContainer.swf");
public var mcContainerLoader:Loader = new Loader();
mcContainerLoader.load(mcContainer);
addChild(mcContainerLoader);
public var viewport:Viewport3D; // The Viewport
public var renderer:BasicRenderEngine; // Rendering engine
public var current_scene:Scene3D;
public var current_camera:CameraObject3D;
public var current_viewport:Viewport3D;
// -- Scenes -- //
public var default_scene:Scene3D; // A Scene
// -- Cameras --//
public var default_camera:Camera3D; // A Camera
public var mcContainerA:MovieClip = new mcContainer();
public var plane_container:DisplayObject3D = new DisplayObject3D();
public var materialVR:MovieMaterial = new MovieMaterial(mcContainer, true, true, false);
public var plane:Plane = new Plane(materialVR, 300, 220, 12, 12);
public function init(vpWidth:Number = 1440, vpHeight:Number = 750):void {
initPapervision(vpWidth, vpHeight); // Initialise papervision
init3d(); // Initialise the 3d stuff..
init2d(); // Initialise the interface..
initEvents(); // Set up any event listeners..
}
protected function initPapervision(vpWidth:Number, vpHeight:Number):void {
// Here is where we initialise everything we need to
// render a papervision scene.
if (vpWidth == 0) {
viewport = new Viewport3D(stage.width, stage.height, true, true);
}else{
viewport = new Viewport3D(vpWidth, vpHeight, false, true);
}
// The viewport is the object added to the flash scene.
// You 'look at' the papervision scene through the viewport
// window, which is placed on the flash stage.
addChild(viewport); // Add the viewport to the stage.
// Initialise the rendering engine.
renderer = new BasicRenderEngine();
// -- Initialise the Scenes -- //
default_scene = new Scene3D();
// -- Initialise the Cameras -- //
default_camera = new Camera3D();
current_camera = default_camera;
current_scene = default_scene;
current_viewport = viewport;
}
protected function init3d():void {
// This function should hold all of the stages needed
// to initialise everything used for papervision.
// Models, materials, cameras etc.
materialVR.doubleSided = true;
materialVR.interactive = true;
materialVR.animated = true;
materialVR.tiled = true;
materialVR.smooth = true;
plane_container.addChild(plane);
}
protected function init2d():void {
// This function should create all of the 2d items
// that will be overlayed on your papervision project.
// User interfaces, Heads up displays etc.
}
protected function initEvents():void {
// This function makes the onFrame function get called for
// every frame.
addEventListener(Event.ENTER_FRAME, onEnterFrame);
// This line of code makes the onEnterFrame function get
// called when every frame is entered.
}
protected function processFrame():void {
// Process any movement or animation here.
}
protected function onEnterFrame( ThisEvent:Event ):void {
//We need to render the scene and update anything here.
processFrame();
renderer.renderScene(current_scene, current_camera, current_viewport);
}
}
}
thank you a lot
Any Papervision Geeks Out There?
any people into papervision who can help?
I've got four movieclips which are used as four materials for four papervision cube front faces.
For some reason, clips 2-4 are scaling horizontally when i use them as materials.
If I use only clip 1 as the material for all four cubes, then the irregular scaling goes away.
For some reason papervision doesn't like movie clips 2-4 (they are all the same width, height, everything set up the same in papervision, etc.).
Anyone experienced anything similar? I'm using great white (24.03.08)
Papervision MovieMaterial
I have 6 MovieMaterials applied to a cube and would like to try and streamline MouseEvents is possible ie. instead of writing out alot of code like face1.addEventListener(MouseEvent.CLICK, face1click) and then
function face1(event:MouseEvent):void etc etc. Don't want to have to write out all of it like this (unless I have no choice). Could I use something like a switch/case statement? I can do this with normal movieclip buttons but it's not working quite the same when using these MoveMaterials.
Papervision Question...
Hi all..
I've got a papervision project using movie materials from the library. The movieclips that I'm using load external swfs. I cannont, for the life of me, get any action out of the loaded swfs. No access to mouse events or anything else. The work fine when I load them straight up into flash...they only stop working when applied as a movie material. Has anyone else had the same problem? Any papervision gurus? Any help is much appreciated.
Papervision Vs Swift 3d
What are the difference between the 2 ?
Is swift 3d more for modeling objects and animation and papervision is more for the interactive/programming part?
How well does papervision fit with swift 3d? do they get along nicely?
Papervision And Flash
Hello guys. Do you know where I can find a tutorial to do this with papervision and flash:
http://www.flashden.net/item/gallery...ervision/26731
I have two projects to do and this is one I want to do to steal the show. thanks so much
x lisa x
Papervision 3D And LightWave
I am about to embark on a project that will be made in Flash CS3 using ActionScript 2.0. It requires the integration of simple, real-time 3D elements. Low polygon primitive shapes with UV maps are about as complicated as it will get.
Papervision looks to be the right tool for the job, and I was wondering if anyone out there who has used Papervision has used LightWave to make 3D content for it. If you have, I would like to know if there are any known issues, pluses/minuses, etc.
Thanks,
-Adam
Papervision 3D Error
The error reads as follows
location description
Plane.as 1017:The definition of base class Mesh3D was not found.
Line 53 of the Plane.as file reads as follows.
"public class Plane extends Mesh3D"
When I located the Mesh3D.as file, which is org.papervision3D.geometry.Mesh3D.as, and made it a class path, I received more error messages. Does anyone know what is going on here?
Papervision Question
I have a cube that I want to rotate 180 degrees. I just cant understand how I stop the rotation?
This is the code I'm using on a button to start the rotation, but I want it stop rotate after 180 degrees:
Attach Code
function Rotate_btn(myEvent:MouseEvent) {
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event):void
{
var xDist:Number = 10;
cube.rotationY += 10;
if(cube.rotationY == 180){
trace("It's time to stop rotating!");
}
renderer.renderScene(scene, camera, viewport);
}
}
To Papervision 3D Experts
HI.
I started to learn Papervision, but it seems more difficult than I thought. I came accros a great tutorial at GoToAndLearn.com but have been having issues with it. I use CS4 and also downloaded the latest version of papervision engine for CS4. I also copied the code to the letter from the tutorial and I still get compiler errors. Something smells fishy to me and I may be missing something. My class files are all importing correctly, but the methods are not found. Here's what I get for errors:
1046: Type was not found or was not a compile-time constant: unit.
Attach Code
import org.papervision3d.scenes.*;
import org.papervision3d.cameras.*;
import org.papervision3d.objects.*;
import org.papervision3d.materials.*;
var container:Sprite = new Sprite();
container.x = stage.stageWidth * 0.5;
container.y = stage.stageHeight * 0.5;
addChild(container);
var scene:Scene3D = new Scene3D(container);
var camera:Camera3D = new Camera3D();
camera.zoom = 5;
var bam:BitmapAssetMaterial = new BitmapAssetMaterial("FlashIcon");
bam.oneSide = false;
bam.smooth = true;
for(var i:unit=0; i<50; i++)
{
var p:Plane = new Plane(bam, 286, 214, 2, 2);
scene.addChild(p);
p.x = Math.random() * 1000-500;
p.x = Math.random() * 1000-500;
p.z = Math.random() * 1000-500;
p.rotationY = Math.random() * 360;
}
scene.renderCamera(camera);
|