[Papervision3D] Collada + ShadedMaterial....
Rob Langston
rob.langston at sbcglobal.net
Tue Jun 3 01:29:24 PDT 2008
Hey, Tim --
Sorry to resurrect this topic, but I'm having the same issue with a
Max3DS object and EnvMapMaterial. Any hints on how to fix? Thanks.
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at org.papervision3d.materials.shadematerials::EnvMapMaterial/
drawTriangle()
On May 25, 2008, at 9:15 AM, Karim Beyrouti wrote:
> Brilliant - It's working. Big Thanks !!!
>
>
>
> -----Original Message-----
> From: papervision3d-bounces at osflash.org
> [mailto:papervision3d-bounces at osflash.org] On Behalf Of Tim Knip
> Sent: 25 May 2008 15:28
> To: papervision3d at osflash.org
> Subject: Re: [Papervision3D] Collada + ShadedMaterial....
>
> Hi, this issue was a bug in DAE.
>
> Just fixed it.
> Please update GreatWhite from svn (rev #576)
>
> Can you check your code now works?
>
> Thanks,
> Tim
>
> 2008/5/24 Karim Beyrouti <karim at kurst.co.uk>:
>> Hi all.
>>
>>
>>
>> I am still trying to get a ShadedMaterial on a DAE object. The DAE
>> has a
>> texture applied to it, which I guess is a BitmapFileMaterial. I am
>> trying
> to
>> re-assign it to a shadedmaterial, and apply it back to the original
>> DAE
>> object.
>>
>>
>>
>> My code waits for the
>>
>>
>>
>> daeFile.addEventListener(FileLoadEvent.LOAD_COMPLETE, _onDaeLoaded )
>>
>>
>>
>> event to be called. After which I grab the bitmap, and assign it to a
>> ShadedMaterial. Like this:
>>
>>
>>
>> private function _onDaeLoaded( e:Event ):void{
>>
>>
>>
>> var s:BitmapFileMaterial =
>> daeFile.materials.getMaterialByName("structure") as
>> BitmapFileMaterial;
>>
>> var bm:BitmapMaterial = new BitmapMaterial(s.bitmap)
>>
>> var shader = new GouraudShader(light,
>> 0x000000,0x00FF00);
>>
>> var testMaterial = new ShadedMaterial(bm, shader);
>>
>>
>>
>> daeFile.replaceMaterialByName(testMaterial,"structure");
>>
>>
>>
>>
>>
>> // ** WORKING **;
>>
>> //var newMaterial:WireframeMaterial = new
>> WireframeMaterial(Math.random()*0xffffff);
>>
>> // daeFile.replaceMaterialByName(newMaterial,"structure");
>>
>>
>>
>>
>>
>> }
>>
>>
>>
>> However I get this error when the code is called:
>>
>>
>>
>> TypeError: Error #1009: Cannot access a property or method of a null
> object
>> reference.
>>
>> at
> org.papervision3d.materials.shaders::ShadedMaterial/drawTriangle()
>>
>> at org.papervision3d.core.render.command::RenderTriangle/
>> render()
>>
>> at org.papervision3d.render::BasicRenderEngine/doRender()
>>
>> at org.papervision3d.render::BasicRenderEngine/renderScene()
>>
>> at com.twentytwenty::worldTest/onEnterFrame()
>>
>>
>>
>>
>>
>> I am not too sure what I am missing here, and would love to hear some
>> thoughts on
>>
>> This one…
>>
>>
>>
>>
>>
>>
>>
>> Thanks…
>>
>>
>>
>>
>>
>> Karim
>>
>> No virus found in this outgoing message.
>> Checked by AVG.
>> Version: 7.5.524 / Virus Database: 269.24.1/1464 - Release Date:
> 24/05/2008
>> 08:56
>>
>> _______________________________________________
>> Papervision3D mailing list
>> Papervision3D at osflash.org
>> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>>
>>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 269.24.1/1464 - Release Date:
> 24/05/2008
> 08:56
>
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 269.24.1/1464 - Release Date:
> 24/05/2008
> 08:56
>
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20080603/2fafe6ae/attachment-0001.html
More information about the Papervision3D
mailing list