Paperview3D: Phong and COLLADA.
category: general [glöplog]
I've been playing around with 3D in flash using Papervision 2.0. And I have a little problem. I don't know what I'm doing wrong while trying to use PhongShader/ShadedMaterial with Collada model.
And when I try to render the scene flash gives me a lot of "Cannot access a property or method of a null object reference." errors. When I replace the collada loading code with sphere:
It works. Anyone knows what is wrong with that? Thanks in advance.
Code:
var materials : MaterialsList = new MaterialsList();
light = new PointLight3D(true);
theScene.addChild(light);
phong = new PhongShader(light, 0xFFFFFF, 0x000000, 20);
shm = new ShadedMaterial(smat, phong);
materials.addMaterial(shm, "std01");
sphere = new Collada("content/sphere.dae", materials);
theScene.addChild(sphere);
And when I try to render the scene flash gives me a lot of "Cannot access a property or method of a null object reference." errors. When I replace the collada loading code with sphere:
Code:
var tmp:Sphere = new Sphere(shm, 1000, 24, 12);
theScene.addChild(tmp);
It works. Anyone knows what is wrong with that? Thanks in advance.
like as you didn't export normals?
I export them.
pouet calling trace, come in trace.
Use the debugger in Flash
I wonder why you though pouet.net was the place to ask this :)
For stuff like that you should ask here:
http://osflash.org/mailman/listinfo/Papervision3D_osflash.org
And I think somebody asked the same question on the list too.
Anyway, as far as I know, ShadedMaterials doesn't work very well on Collada objects yet. I may take a look on the sources and see what's going on. Try with DAE instead of Collada see if it helps.
For stuff like that you should ask here:
http://osflash.org/mailman/listinfo/Papervision3D_osflash.org
And I think somebody asked the same question on the list too.
Anyway, as far as I know, ShadedMaterials doesn't work very well on Collada objects yet. I may take a look on the sources and see what's going on. Try with DAE instead of Collada see if it helps.
collada in flash? i better hope its converted
converted to what?
@zplex: I know how to debug AS and I'm using the debugger. :P
@+: Why pouet? It was a blind shot. :) And thanks for your help. I changed my model's class from Collada to DAE and it works!
@+: Why pouet? It was a blind shot. :) And thanks for your help. I changed my model's class from Collada to DAE and it works!
sorted then ;)
random survey: how many demosceners out there are using collada? (for either their scene stuff or their work stuff)
smash: i know duckers of outracks is, and i know i met the guy who wrote the damn thing (and so have gargaj :)
he did collada for the lulz!
gloom: "the guy who wrote the damn thing" - which guy exactly, there's a bunch of them. :) mainly from scea.
smash: Remi Arnaud is his name, and yes, he was a graphic architect at SCEA. Of course, I guess he didn't write it all by himself, but I believe he said that he started it all (and he had enough detailed knowledge about COLLADA to make me believe him for sure :)
gloom: yep, that him. he doesnt work for us anymore, though - he's gone to intel.
so, namedropping aside :D - im just curious to know if anyone's using it.
so, namedropping aside :D - im just curious to know if anyone's using it.
smash: I am currently using COLLADA for some stuff as well. It's mostly experimental so far, but it seems to be working out somehow, so I might keep it.
gloom: Wow, you're so exclusive.
kusma :what 3d tool are you using, and what exporter? :)
(should have added that question to the original survey, really)
(should have added that question to the original survey, really)
smash: I'm using 3DS Max and the ColladaMAX exporter. To import the data, I'm using FCollada. There's definitely issues with it, and I'm not sure I would have used it for anything "high-end" yet. I'm thinking of switching to ColladaDOM, but for what I'm currently doing, it's working out well enough. It's not like MaxSDK is very pleasant to work with either. ;)
damn, and reading all this stuff i thought collada was some super awesome media threedee tool thing suite whatever, that i hadn't ever heard about but all the hip sceners used it. turns out it's yet another threedee file format. what an anticlimax :-(
skrebbel: you misunderstand -- collada is the fix for everything wrong with demomaking, you're just not reading it right. ;)
kusma: indeed i am (or, i just dropped the only knowledge i had about collada - i met a a french guy you talked about for hours and i didn't really understand diddly squat :) if that makes me exclusive then whatever :)
kusma: indeed i am (or, i just dropped the only knowledge i had about collada - i met a a french guy you talked about for hours and i didn't really understand diddly squat :) if that makes me exclusive then whatever :)
"Collada is not a data exchange format, it's a container."
As kusma, I also use 3DS MAX and ColladaMAX. I would love to move to Modo tho, I wonder how's the collada support on it.