http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/graphs/bsp/BSPTree.as
see line 604
Basically if you know the material ( which is kind of tricky and not
really viable ) then you can replace it. If you want to replace all of
them with a single material then my approach is to loop through all
materials in the BSPTree and substitute it for my ghost class. The
basic idea is that the ghost class allows you to set the material to
null ( when using collada model as visual ) or allows you to update it
without always looping all materials, it does this via proxying the
render events. I am not sure if it fits your needs but it should work
and I have already posted enough code for you to try it.
http://groups.google.com.ph/group/away3d-dev/browse_thread/thread/97d078b526b343c6
If you have some opensource model you have built and some code example
you can opensource I can take a look and amending the code for you and
publish the example back to the list if time permits.
But I think you need to modify the away source files to get more
control of AWD materials.
Cheers
;j
On 26 Oct 2010, at 10:06, le_unam wrote:
i searched around and i found something like _tree.replaceMaterial,
but it seems to doesnt exist anymore. Anything like this to replace
materials?
On 26 Okt., 10:34, le_unam <[email protected]> wrote:
hey i tried a little bit and i found the centralmateriallirbary ...
my
thoughts were that i replace the materials of centralmateriallirbrary
with my materials. that works when tracing the materials, but in the
tree the original materials are shown. where are the
centralmateriallirbrarie-materials loaded to the bsp_tree? i dont
want
to add my loader code to the awdata class. hope you understand what i
want to say ^^
On 22 Okt., 19:20, "[email protected]" <[email protected]>
wrote:
Not followed all this thread but...
In AWData class around line 242, the materials are set
var matBitmap:BitmapFileMaterial = new BitmapFileMaterial(resolvedP
+line)
if you look at the file loaded you will see the materials are
defined
near the end of the file.
Its easy loading your own materials ( so don't bother with
bulkloader ) but not so easy to overwrite AWD materials with the
current way the AWData and BSPTree are set up as once the material
is
set on the BSPTree it is set on every face, there is a
replaceMaterial
method, but it assumes you know the CentralLibrary material used so
that you can search and replace on every face to do the swap.
Take a look at my posts on the ghost material they may give you some
ideas as was trying similar stuff.
Cheers
;j
On 22 Oct 2010, at 13:44, le_unam wrote:
thank you fabrice = )
i will try it as you say, my thoughts were that anywere must
awdata be
told where to get the images, but now i think this is set by
default
and only if you want to change something you have to add
something, so
i can search my whole live for this ^^
well of course i tried the caching thing and it doesnt work ... the
preloaderloads all images then hte 3d starts and all images come up
step by step again, so its double loaded. when i dont start the
whole
3d after loading, but only call the _view.render after loading it
seems to work, but i cant be sure that the images are double loaded
too, in the background. i think they will, so i want to go a safe
way.
i try to follow your explaination. i think i understand what you
want
to tell me ... thank you very much.
and dont forget, i`m really very sorry ;-)
On 22 Okt., 14:32, Fabrice3D <[email protected]> wrote:
really really really last time :))
my problem is that i dont know where and how awdata defines a
material, cause in the as-file is nothing like bitmap
AWData is in loaders package, it has nothing to do with the as
Prefaboutputs.
search in AWData class "BitmapFileMaterial" and reread (carefully)
previous mail
in the as thatPrefaboutput or in your project file,
just add a listener to start the render once your bulkloader as
done its job
Again: have you tried feed your bulkloader with the urls (to be
found in the awd file)
and simply start your project after that?
Chances are that all images are cached and will be displayed at
init with zero code changes!
Fabrice
On Oct 22, 2010, at 1:55 PM, le_unam wrote:
thanks for spending so much time for me ... well i dont want
to get
the whole code for my problem, so i dont want to use copy and
paste
and i can follow your instructions and i know what you want to
tell
me. my problem is that i dont know where and how awdata defines a
material, cause in the as-file is nothing like bitmap or
bitmapfile or
bitmapfilematerial. im sure i have to look more behind, but some
words
like "parse" dont have any clear meaning for me, so its difficult
for
me. cant you tell me simple where the awdata defines the
material?
the
prefabcode for this is everytime same isnt it? it would be really
nice and this really will be my last question for this thing. you
helped me very well with your informations, although it looks
like
you
didnt ^^
On 22 Okt., 11:52, Fabrice3D <[email protected]> wrote:
I do not recall speak about loaders anywhere.
Let me try one last time:
where AWData defines a material, it uses bitmapfilematerial
replace that with a normal bitmapMaterial
make a tmp bitmapdata like 16x16
pass it to material.
--> now you have replaced "load automatically the source image"
by "I make a temp material with very tiny image"
Add after that your queue object or whatever name that is in the
api you use
var queueItem:QueueItem = new QueueItem(urlfile, material);
yourWhateverBulkLoader.addToQueue(queueItem);
you probably will have to import your class in awd for this.
--> now you have passed to your api, the url to load the image,
and the material refference
in the event where your queueloader triggers per loaded image
somefunctionImageLoaded(queueLoaderEvent:QueueLoaderEvent):void
{
BitmapMaterial(queueLoaderEvent.data).bitmap =
queueLoaderEvent.bitmapdata;
}
--> each time an image is loaded, you replace the 16x16 tmp
bitmap by the right one that has just finished to load
In your main project:
yourWhateverBulkLoader.addONEverythingLoaded(startawd);
--> when all images are loaded, its time to start the 3d party.
all materials will have the propper bitmap set
Again, do not copypaste or argue on methods name, its a
speudocode principle to show you how to implement.
It will very on api and your project construct.
But if you simply load all your images first then start your
project when all loaded as now, with zero changes
the images to be loaded by awdata (already preloaded by the
bulkloader) are probably cached and would be there instantly.
Fabrice
On Oct 22, 2010, at 11:16 AM, le_unam wrote:
well i`m sure for you its no problem, but im not a pro like
you ^^
maybe you can help me when i give you some code.
as you know the awdata-line is the following:
_tree = BSPTree(AWData.parse(new BSPFile()));
i get access to the loaded images like this:
loader.getBitmap("filename.jpg");
what can i do with this? how can i change the awdata line :-/
im really sorry for my missing knowledge
On 21 Okt., 17:21, Fabrice3D <[email protected]> wrote:
as I wrote in previous mail, just alter the awdata where it
generates the bitmapfileMaterial
you could have a tmp small bmd, to pass instead of using
bitmapfilematerial, then when loaded asign it to the material
predefined.
dunno what these loaders api are doing, but building a loading
queue is not rocket science. All you need is pass to queue
item
the ref to the material.
This would require one or two lines changes in awdata to be
fully working.
Fabrice
On Oct 21, 2010, at 2:05 PM, le_unam wrote:
how can i tell the _tree = BSPTRee(AWData.parse .... should
get the
images from the library than from images-directory?
On 21 Okt., 12:33, Michael Iv <[email protected]> wrote:
That what I meant under "commercial project " :)
Sent from my iPhone
On Oct 20, 2010, at 2:45 PM, banal <[email protected]>
wrote:
You probably misread the license then. It is free for
commercial use,
*except* for projects where you charge a fee from the users
that are
using the product.
In the words of the author:
----
The code will be used in a commercial game, web site,
component, or
software product for which a usage/access/license/
microtransaction fee
is collected from multiple customers.
----
That's the only case where you need to buy a "commercial"
license. In
most cases, this doesn't apply.
On Oct 19, 2:41 pm, Michael Iv <[email protected]>
wrote:
You are absolutely right it is even better in some aspects
than Bulk BUT it
is not free for commercial use.
On Tue, Oct 19, 2010 at 2:39 PM, banal
<[email protected]>
wrote:
Slightly off-topic, but if you like BulkLoader, have a
look at
"LoaderMax" (https://www.greensock.com/loadermax/).
It's my new Bulk-Loader of choice :-)
On Oct 18, 12:58 pm, Michael Iv <[email protected]>
wrote:
You may use open source BulkLoader (see gogle code)
powerful lib for
managing multiple loads
On Mon, Oct 18, 2010 at 12:49 PM, le_unam
<[email protected]> wrote:
what does bulk load mean? never heard about it = /
On 18 Okt., 12:34, Fabrice3D <[email protected]>
wrote:
Just bulk load the images, once loaded you init the
awd
file
Fabrice
On Oct 18, 2010, at 11:48 AM, le_unam wrote:
Hey, i have finished my first bsp project and now i
want to create
a
preloadercause it is not really nice, if the user has
a white
...
Erfahren Sie mehr ยป