MAD VERTICES Community Forum : Launch!
Papervision 3D Core Training:
• PV3D "Setting Up" : View Examples & Source / Video
• PV3D Intro - Hello World : View Examples & Source / Video
• PV3D Material Basics : View Examples & Source
• PV3D Primitives : View Examples & Source / Video (1) (2) (3) (4) (5) (6)
• PV3D Text : View Examples, Source & Custom Font Implementation (*NEW*)
• Swift 3D & PV3D : View Examples & Source
• PV3D Collada (DAE Files) : View Examples & Source
• PV3D Object Properties & Interactivity : View Examples & Source
• BasicView Overview : View
• PV3D Development in Flex (Part 1) : View Video (*NEW*)
• PV3D Development in Flex (Part 2) : View Video (*NEW*)
Advanced Materials
• Applying Shader Materials : View Examples & Source
• Applying Shaders w/ ShadedMaterial : View Examples & Source
• Shaders w/ ShadedMaterial Explained : View Example, Source & Diagram (*NEW*)
Effects, Filters & Modifiers
• Casting Shadows : View Examples & Source
• Apply filters to objects within your scene : View Examples & Source
• Applying Modifiers : View Examples & Source
Animation
• Animation using Tweener : View Examples & Source
• Animations w/ Bezier Curves: View
• Animated DAE Files (ASCollada): View
Exercises:
• Interactive Objects Video Exercise: View
• Displaying Collada Files Exercise (built with Swift 3D): View
Random Tips & Info:
• ecodazoo-ish Object Controls: View (*NEW*)
• lookAt, point objects at other objects, etc: View
• hitTestObject, simple method for hit detection: View
• distanceTo, calculate distance between objects = very cool uses: View
• Update materials at runtime: View
• Loading External .SWF Files as Materials: View
Swift 3D Support:
• Swift 3D & Papervision Basics / Overview: View / Video
• DAE File Viewer (Pre-coded, just plug in. Has pre-build controls as well): View
• Apply WireframeMaterial(s) to your Model (Easy mod of ERMain.as): View
skip to main |
skip to sidebar
Jim Foley's Brain. Flex, Flash, Papervision 3D, Swift 3D and other cool stuff.
Back on top ^
created by Nuvio | Webdesign
MAD VERTICES © 2008 Ken ahlin | Converted to XML Blogger Template by ThemeLib
Nice, keep up the good work!
Just what I was looking for.
Jim,
Your site is the best kept secret in the Flash community!!! Your examples and tutorials are invaluable. I have spent weeks trying to pull information tidbits from numerous other sites, when I could have found all of it right here. I downloaded all of the source files from this blog and I cannot wait to go through each of them to learn more. Keep up the amazing work! I will be visiting your site often.
Thanks,
Aaron Waldon
www.aaronwaldon.com
Thanks for your hard work to support the Flash community! The PV3D tutes are great. The only problem seems to be bandwidth. I'm on broadband cable and can only get the videos to download at 35 Kb/sec at best. This is at 5:30 in the morning when traffic is usually slow. It takes over 30 minutes at this rate. Any ideas?
Hey, thanks for the comments guys. I'm working on getting some better hosting. Will have it updated before long.
This is probably because you are still working on the new hosting problem... But pretty much all the links are dead :-( I would love to check out your tuts, but none of the links work! Please update I really want to try those tuts out!
Thanks,
-Joe
Joe, the server that was hosting all the files went down today. It is back up and running.
*Bows* thank you sir! tuts are awesome!
I understand this is not the place but your e-mail below does not work:
This is an automatically generated Delivery Status Notification.
Delivery to the following recipients failed.
jim.foley@madvertices.com
--Forwarded Message Attachment--
From: adamray22@hotmail.co.uk
To: jim.foley@madvertices.com
Subject: PV3D Collada (DAE) Files (V) example
Date: Sat, 16 Feb 2008 21:08:54 +0000
Hi,
I have been playing around with your example PV3D Collada(DAE) Files (V) and I am only getting a grey screen in Firefox when I run it?
I have great white installed and have a relatively OK understanding of PV3D but I can't make this work :(
The code really is the same from your site. My source Path is correct and the .JPG and .dae are in my directory.
I think I am going to start pulling my hair out
The code is as folows:
package {
import flash.display.Sprite;
import flash.events.Event;
import org.papervision3d.view.Viewport3D;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.materials.BitmapFileMaterial;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.parsers.Collada;
import org.papervision3d.render.BasicRenderEngine;
public class fine2 extends Sprite
{
private var viewport: Viewport3D;
private var scene: Scene3D;
private var camera: Camera3D;
private var bitmapFileMaterial: BitmapFileMaterial;
private var colorMaterial1: ColorMaterial;
private var colorMaterial2: ColorMaterial;
private var colorMaterial3: ColorMaterial;
private var collada: Collada;
private var renderer: BasicRenderEngine;
public function fine2():void
{
trace("hello");
//viewport = new BasicRenderEngine(width, height, scaleToStage, interactive);
viewport = new Viewport3D(550, 400, false, true);
addChild(viewport);
//instantiates a Scene3D instance
scene = new Scene3D();
//instantiates a Camera3D instance
camera = new Camera3D();
//renderer draws the scene to the stage
renderer = new BasicRenderEngine();
//BitmapFileMaterial, doubleSided draws the color on both sides of the geometry normals
bitmapFileMaterial = new BitmapFileMaterial("clockFace.jpg");
bitmapFileMaterial.doubleSided = true;
//ColorMaterial, doubleSided draws the color on both sides of the geometry normals
colorMaterial1 = new ColorMaterial(0xD3C8AD);
colorMaterial1.doubleSided = true;
//ColorMaterial, doubleSided draws the color on both sides of the geometry normals
colorMaterial2 = new ColorMaterial(0xB8A67C);
colorMaterial2.doubleSided = true;
//ColorMaterial, doubleSided draws the color on both sides of the geometry normals
colorMaterial3 = new ColorMaterial(0x000000);
colorMaterial3.doubleSided = true;
//MaterialsList acts as an object array that holds all the related materials
var materialsList:MaterialsList = new MaterialsList();
materialsList.addMaterial( bitmapFileMaterial, "clockFace" );
materialsList.addMaterial( colorMaterial1, "color1" );
materialsList.addMaterial( colorMaterial2, "color2" );
materialsList.addMaterial( colorMaterial2, "color3" );
materialsList.addMaterial( colorMaterial1, "color4" );
materialsList.addMaterial( colorMaterial1, "color5" );
materialsList.addMaterial( colorMaterial2, "color6" );
materialsList.addMaterial( colorMaterial2, "color7" );
materialsList.addMaterial( colorMaterial3, "hourArm" );
materialsList.addMaterial( colorMaterial3, "minuteArm" );
//collada = new Collada(.dae file, MaterialsList applied to object, scale);
collada = new Collada("clock.dae", materialsList, .1);
scene.addChild(collada);
//set up enterFrame event
addEventListener(Event.ENTER_FRAME, onEnterFrame);
//define enterFrame Method, render the PV3D Scene and animate the primitive
function onEnterFrame(e:Event):void
{
collada.rotationY += 2;
renderer.renderScene(scene, camera, viewport);
}
}
}
}
Hi Jim,
Useful, site, thanks! I'm diving in headfirst on the Swift3d & Papervision relationship. It seems your first PV "setup" video has audio, but the ones after that do not have audio. Is that true? I'm running OSX on a intel macbook pro using both firefox and safari.
Thanks,
Loren
Hey Jared, that is correct. the other videos do not have audio. I'd like to get audio on them someday but they are on the back burner for now.
Thanks a lot. These tutorials are great fun and easy to get into!
..and to be honest, I don't think adding audio should really be a priority either, as the video and commented code make it relatively straightforward to follow, IMHO.
I'm a newb with Flash, AS3, and Papervision, just ran across your blog. This looks like a great resource! Some day when I try and tackle Papervision, I'll definitely be going through these tutorials. Thanks!
There is line in a sample:
materialsList.addMaterial( colorMaterial3, "hourArm" );
AFAIUI, there is an object "hourArm" in collada model. How can I get this object (array of all objects)? Can I add events to any objects in collada?
@Daniel - If I were going to add events to individual objects in my scene I would export each of my objects as their own .dae file. Then, embed them into a single scene and apply events to them.
Thanks for answer, Jim!
Yesterday I found one more sample:
http://www.nabble.com/Re%3A-InteractiveScene3DEvent-and-dae-models-p15879302.html
And it works.
public function PV3DCollada():void
{
...
collada = new Collada("clock.dae", materialsList, .1);
collada.addEventListener(FileLoadEvent.LOAD_COMPLETE, DAELoaded);
...
}
function DAELoaded(e:Event):void
{
var xxx = collada.getChildByName("Groupof3Objects-Geometry").getChildByName("Lathe-Geometry");
xxx.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, onSomeInteractiveScene3DEvent);
}
@ Daniel - excellent find. I'll give it a shot and post up on it. Also, while on the subject, I should post about loading in models, etc...
Jim, you're professional in Papervision and other techniques. I'm not. Maybe, you can show me the best way to do it: http://www.nabble.com/Complicated-menu%3A-some-questions.-td16271788.html
I can not tell you how much those videos helped me.
Tons of thankyou.
Pedro Paulo Almeida
Brazil
great site. your examples help me a lot.
but i can't find a solution for a problem, wich made me troubles for the last few days. how can i import collada files to my *.swf so i don't have to load them from a server.
i can export the 3d model as an *.as file but i can't put a texture on it like this: http://papervision2.com/loading-complex-models/
Thanks for your tutorials but I can't hear the sound of the videos made with camtasia. The first one I can listen it. Anybody can help me? Thank you!
Laia,
Spain (Barcelona)
A big thanks for this tutorial.
I think these videos are insanely helpful, but audio would definitely help someone like me. The little extra explanations in the 1st video were as helpful as the general explanations.
Is there a way to export a model with animation out of SWift 3d into papervision so the model still has the animation attatched to it?
Thanks,
Ryan
@ryan s - no, there isn't. Although, Erain says they will try to make that a features for Swift 3D v6.
Thank you very much for sharing. Very interesting stuff. Didn't realise how papervision is so cool.
Hi!
I can't get the articles from the old location, PV3D "Setting Up" to Animation using Tweener (VII).
Thanks in anticipation.
great blog!
about the pv3d-tutorials: as i can see the first link doesn't seem to work:
"Bad Request (Invalid Hostname)"
Yeah, it looks like none of the tutorial links work.
I don't seem to be able to view the tutorial, it kept saying "Bad Hostname", anybody getting that? Much appreciated!
I'm trying to work with Papervision 3D to use in a project we're working on. Whilst we have made some progress through trawling the web, I'm only getting so far with finding what I need and I'm getting more and more frustrated! My main problem is that my ActionScript knowledge is very basic and any tutorials I find seem to start from 'stage 3 or 4' rather than 'stage 1' because an assumption is made that we all know ActionScript. I am usually pretty good at adjusting the ActionScript to work for me so if I could find a tutorial that basically answers my problem, I'll probably make progress. The example I have is a series of cubes connected together. I can create these cubes in Swift 3D or in Max and export them to Flash no problem but I want to have each cube do something different. How do I do this? Please help or point me in the right direction. Many thanks.
None of the links are working. Please, please, please fix it. jejejeje Thanks :-)
The links are up again. Sorry for the delay and inconvience!
jim, you're my hero!
Hi, I really like your tutorials - very simple and clear! But I got into a weird problem- I followed every step from setting up to creating the PV3D hello world class. But when I tried to compile it in FlashCS3, Flash reported a compile error said "#1020, Method marked override must override another function" . It led me to the Triangle Mesh3D class. Do you know why this occurred?
P.S. I'm using the lasted GreatWhite version
hi, problem solved, I have 1.5 version installed and I deleted that one from the class path, everything worked!
Thanks for the links!
These tutorials are a big help!
great tutorials! a real help
just wondering if anyone else is having the same problem as me whenever i try to publish an fla i get... 1067: Implicit coercion of a value of type org.papervision3d.core.geom.renderables:Vertex3D to an unrelated type org.papervision3d.core.geom:Vertex3D.
That error typically happens when you're programming Papervision 2.0 code but you have the Papervision 1.5 library. Might make sure you have the 2.0 code set up correctly. Are you using content that is published from Swift 3D?
Hi Jim,
Worked a treat i had to delete every copy of papervision off my mac then use a pc to download the svn (wouldnt work with svnx for some reason). but now i have a fresh copy its all good.
Thanks :)
Hi Charile,
I have same error "1067: Implicit coercion of a value of type org.papervision3d.core.geom.renderables:Vertex3D to an unrelated type org.papervision3d.core.geom:Vertex3D" . I saw that you reinstalled Papervision and I did it too but it didn't help. I'm using PV3D components 1.5 and Papervison3d 2.0.
Hi Jim
Thank you very much for great work.
When ever there’s any new innovation it’s very hard to find the boundary of that technology or concept. I found you’re explanation is the best at first shot, and I leart basic very quickly without any hassles.
Once again thank you very much
Nazeer B
@Dejan
At my best guess I would suggest uni stalling the 1.5 component as well, restart your machine and make sure you have the latest version from the svn ... the zip version on google code site didn't seem to be as up to date as the svn version
Charlie
Hi Charile,
Ok, now it works. I didn't mentioned that I'm rookie in Flash AS3 and PV3D. But this time I've only reinstalled PV3D Components without installing PV3D source code(non-compiled).I still have problem with exported DAE from Maya, I don't see model on stage and it doesn't want to render in Flash, while Blender's DAE works correctly.
Thanks!
perfect tutorial to get started with pv3d, thanks!
you are the best, you have made something mind boggling into something I can understand and apply in my own way. I am a 3D artist new to flash and Papervion3D. All I wanted to do is put some of my 3D models up on my website, now it looks like am getting addicted to this flash and PV3D stuff.. thanks!!!! (I hope..)
Jim,
I am finding difficulty in parsing DAE files vs. parsing Collada files. I know I've imported the right classes and everything, but I just can't seem to get things to work. I'm using trueSpace 7.6 (which is free, as everybody knows now), and exporting DAE files. I can get my wire mesh to show up correctly, but when I apply the material to the shape, it's not mapping correctly.
For example, I made a shark in tS, exported the DAE, got the shape to load with Papervision3D, but when I apply the bitmapFileMaterial, I get the error message:
"MaterialObject3D: transformUV() material.bitmap not found!"
So then I use the Collada parser, and I get errors all over the place.
If I go back to the DAE parser, and use BitmapAssetMaterial instead of BitmapFileMaterial, I get my 3D shaped loaded again, and I see "a" material loaded onto my model, but it's almost as if the texture mapping is completely off.
Do the different 3D programs export .dae files differently? Why can't I use the collada parser to load this model? Also, are you familiar with any issues regarding texture mapping with .dae files in papervision?
Any help you can give is much appreicated at this point. I usually don't post in comment sections, but I'm at my wit's end on this...
Thanks for your time!
Hey Jarred,
Just an FYI, I would use the Collada parser if your model doesn't contain animations.
As for your materials problem, are you using a MaterialsList object with your Collada?
If you are great! Then my next question would be are you applying your material to the materials list correctly?
myMaterialsList.addMaterial(...);
If so, sweet! Then are you applying your material to the collada file's assocaited material name (which is specified in TrueSpace).
myMaterialsList.addMaterial(myMaterial, "theMaterialName");
The material name should be defined in TrueSpace in the Material Editor. Whatever you name your material in TrueSpace is what you will typically use as the addMaterial's second parameter.
If you're not sure of how to get this or if TrueSpace just exports funky stuff then use "all" as the second parameter.
myMaterialsList.addMaterial(myMaterial, "all");
Then, ofcourse your materialsList needs to be applied to your collada object when you instantiate it.
Hope one of these steps helps you find the error. Let me know if you're still having troubles. Cheers mang.
@ Jim
Thank you so much for taking time to look at my question, I really appreciate it!
Now, onto business...
I'll paste the related code...
I'm importing the right classes.
import org.papervision3d.materials.BitmapFileMaterial;
import org.papervision3d.materials.BitmapAssetMaterial;
import org.papervision3d.materials.utils.MaterialsList;
I'm also setting up my material, and applying it to my DAE...
var myNewMaterial = new BitmapFileMaterial("file_0.png");
materialsList = new MaterialsList();
materialsList.addMaterial(myNewMaterial, "all");
//add dae object
daeFile = new DAE()
daeFile.load("sharker.dae", materialsList);
I've posted my results here:
http://www.truschke.com/shark/collada.html
The directory http://www.truschke.com/shark contains the files that I am using for this project. For example, you can also see the material that trueSpace created as well at:
http://www.truschke.com/shark/file_0.png
It just doesn't seem like things are getting mapped correctly. I've tried the "all" as well as "material_0" (which is what truespace named the shape). Both of them give this exact same result.
Thanks again for your time!
Looks to me like you did a baked texture on your model in TrueSpace. But, the model you are exporting does appear to have the same UV coords. When you have your shark in TrueSpace and you apply your material, bake it and then export your mesh are you "flattening" the material modifications / effects so they aren't dependant upon proprietary TrueSpace features? Does that make sense? I'm not familiar with TrueSpace so bare with me. If I were using 3ds max, I would have a number of Modifiers applied to get the effect I'm after but when i export the mesh it needs to have the modifier stack collapsed so that all effects are "flattened". It looks like this could be the case with your model. Hope this helps.
This site rocks!
But I´ve got the same problem with Maya+Collada.
I export my object with the collada-export.
-Bake transforms
-Relative Paths
-Triangulate
are all on true
Is there anything I missed to check? When I import my .dae into AS3 I use this code
public function Start() {
trace("Start");
addEventListener( Event.ENTER_FRAME, loop );
viewport = new Viewport3D(800, 600, false, true, true, true);
addChild(viewport);
renderer = new BasicRenderEngine();
scene = new Scene3D();
camera = new Camera3D();
camera.z = -2500;
camera.x = 500;
collada = new Collada("SokoTexture01.dae");
holder = new DisplayObject3D();
holder.addChild(collada);
trace("Ausgabe");
scene.addChild(holder);
stage.addEventListener(Event.ENTER_FRAME, renderStuff);
}
Sometimes it works within seconds...and sometimes he traces me
"MaterialObject3D: transformUV() material.bitmap not found!"
over and over and nothing happens.
Sorry for my english...greetings from germany. ^^
If anyone got an idea, please let me know.
Thx!
TZP
I've got some questions as to why it would be giving occasional errors and not being consistent.
Can you post your question here so it will be a little easier to read and ask questions?
http://madvertices.yuku.com
So, first, is your project always the same file, in the same location and it still comes back with errors at random? Or are you viewing your file from different locations and getting different results?
I've got some questions as to why it would be giving occasional errors and not being consistent.
Can you post your question here so it will be a little easier to read and ask questions?
http://madvertices.yuku.com
So, first, is your project always the same file, in the same location and it still comes back with errors at random? Or are you viewing your file from different locations and getting different results?
I´m sorry, I didn´t know that.
But to make it quick: Yes, all files are in the same folder.
It works instantly when I turn off the rotationY of my object.
So I guess there´s a reload of the texture everytime he rotates and maybe the rotation is faster than the loading.
Sorry for posting another comment but it will be the last. I found something like a solution: Reduce the faces!
My object came up with >300 faces and that´s to much for pv3d.
Now I got >100 faces. He still traces me the ERROR-Message but at least it´s working. ^^
Cool mang. If ya still need help let me know. Post over at http://madvertice.yuku.com :-)
Him Jim!
Thanks for the great tutorials!
I've been wondering why when i do "test movie" from within flash, the movies works fine,
and when I try to load the SWF after publishing it i see a blank page...?
Any ideas?
Thanks!
Roey
ro - hey man, can you post your questions here http://madvertices.yuku.com
But, to follow up on your question, are you trying to view your model from your server? Or locally? If locally, how are you viewing them? Also, is your directory all set up to point to the right files when exported, etc...
Jim,
I've been following your papervision tutorials online, they're excellent! I wish that Papervision would link to these off their blog or google code page. For some reason they make it hard to find such resources and I had to do a google search to find your site.
So, I wanted to take a second to say thank you and to also point out two small errors.
Bitmap: Materials Example
1. The file download is missing the .png file.
2. The code on your Web site has a typo in the import statement (There's a "p" after bit):
import org.papervision3d.materials.BitpmapFileMaterial;
should be
import org.papervision3d.materials.BitmapFileMaterial;
Thanks again.
@StrayHand - thanks man. Good eye. I'll try to get those errors fixed.
I cannot get the ParticleField to work. I used the code supplied here and whether I publish from Flash or Flex, it immediately goes into 'Not Responding' on Windows. Am I doing something wrong? All other examples have compiled perfectly.
@KS - Hmmm, looks like the PV3D code has changed since I wrote that part of the tutorials.
I did an updated sample here:
http://content.madvertices.com/articles/PV3DTraining/assets/src/21-Particles/Particles.html
Soure here:
http://content.madvertices.com/articles/PV3DTraining/assets/src/21-Particles/Particles.zip
great tutorials! thanks for putting in the time
Anyone know how to import a UGS NX5 model into Flash via Papervision (or really any way)?
audio doesn't work! please check!
Yes, the audio sucks. I'm aware, haha.
As for UGS or NX5 models, I'm really not sure but I doubt they are supported by Papervision. Your best bet is to use .dae files.
Great tutorial! Thanks for providing videos!
Isn't possible to download movies?
I haven't Internet at home :/
Wow!!
Thanks!! this is just what i was looking for
Sooo annoying the audio not working...
I found similar information on www.3D-News.net (not my website)
This may help people looking for information on the topic.
It seems when I try clicking on any content on your site, I get the error: "Bad Request (Invalid Hostname)"
I'm antsy to check out your tutorials! hehe
Sorry guys, my hosting services decided to change the IP Address on me for whatever reason. The links and content should be back up now.
Jimbo
very nice an useful tuts thank you all