[Papervision3D] BitmapFileMaterial problem

Justin Lawerance Mills JLM at justinfront.net
Tue Feb 5 07:31:41 PST 2008


Claudio

I think you need to get your hands dirty and look in the  
BitmapFileMaterial class? It is probably an issue with the same  
instances being reused because the filenames are the same. It might  
be as simple to load the bitmaps and then assign them to materials in  
your own class that's what I did in as2 (loadArrayMaterial and  
attachArrayMaterial).

I need to port these classes to as3 anyway soon as I need to update a  
project and I many not have time to use all the 'correct' pv classes,  
I will let you know if I do.

;J

On 5 Feb 2008, at 14:27, Claudio Burtschenko wrote:

> hi justin
>
> i tried to remove the listener -> but nothing changes!?
>
> *i removed the listener in all methods and . . . . *
>
>
>
> when i load the same image the second time, i get this
>
> -> material.loaded = true       (first time false)
>
> should i work with that boolean!?!? damnn
>
> cheers
>
>
>
> Justin Lawerance Mills schrieb:
>> have you tried removing the listener?
>>
>> On 5 Feb 2008, at 13:31, Claudio Burtschenko wrote:
>>
>>
>>> hi,
>>>
>>> see my question below...
>>>
>>> i don`t now how to handle that problem!?
>>>
>>> cheers
>>> c
>>>
>>> please
>>>
>>>> hi guys,
>>>>
>>>> one question about loading external image with BitmapFileMaterial:
>>>>
>>>> if i make this the first time
>>>>
>>>> createMaterial{
>>>>     var material:BitmapFileMaterial=new BitmapFileMaterial(
>>>> "sample.jpg"  );
>>>>     material.addEventListener (FileLoadEvent.LOAD_COMPLETE,
>>>> createMap);
>>>>     .....
>>>> }
>>>> -> createMap...{creates a plane with the sample.jpg material}
>>>>
>>>> when i say -> scene.removeChild (myPlane)
>>>> and i "createMaterial" the second time,
>>>> FileLoadEvent.LOAD_COMPLETE doesn`t
>>>> fire createMap!!!???
>>>>
>>>> it works just one time!?
>>>>
>>>> when i try it with an another imagePath, it works the second time:
>>>> createMaterial{
>>>>     var material:BitmapFileMaterial=new BitmapFileMaterial 
>>>> (  PATH  +
>>>> ".jpg" );
>>>>     material.addEventListener (FileLoadEvent.LOAD_COMPLETE,
>>>> createMap);
>>>>     .....
>>>> }
>>>>
>>>> but also just one time!?!?
>>>>
>>>> how can i load the same BitmapFileMaterial several times on a new
>>>> plane!?
>>>> did i forget something..(garbage!?)
>>>>
>>>> would be nice to get some help or ideas
>>>> cheers
>>>> c
>>>>
>>>> FULL CODE:
>>>>
>>>> function getMat () {
>>>>
>>>>     var material:BitmapFileMaterial=new BitmapFileMaterial(pathPic
>>>> + j +
>>>> ".jpg");
>>>>
>>>>     arr[j]=material;
>>>>     material.addEventListener (FileLoadEvent.LOAD_COMPLETE,
>>>> createMap);
>>>>     material.oneSide = true;
>>>>     material.smooth = true;
>>>>
>>>>     j++;
>>>>
>>>> }
>>>>
>>>> function createMap (event:FileLoadEvent) {
>>>>
>>>>    var p:Plane = new Plane(arr[i], 150, imageSize[i], 2, 2);
>>>>
>>>>     p.x = -250 + (165 * inX);
>>>>     p.y = (45*(rows-inY)) + (-50* inY);
>>>>     p.z = -2000;
>>>>     p.rotationX=90;
>>>>     p.visible=false;
>>>>
>>>>     scene.addChild (p);
>>>>
>>>>     if (i<picLength) {
>>>>         getMat ();
>>>>     }
>>>>     i++;
>>>> }
>>>>
>>>> <http://dict.leo.org/ende?lp=ende&p=eL4jU.&search=times>
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>
>>
>> _______________________________________________
>> 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




More information about the Papervision3D mailing list