BSP Prefab 1 to Away3d 3.6 on FlashDevelop NOT WORKING

Software: Prefab3D

alfred, Newbie
Posted: 01 July 2014 11:02 AM   Total Posts: 4

Hello everyone,

First of all I’d like to congratulate everyone working on Prefab and Away3D. It’s really wonderfull all the amazing things you guys have been developing and, on top of that, the fact that you’re distributing all this for free.

However…

Don’t get me wrong, but I’ve been trying to work with Away3D for the last four days and it’s been a kinda frustrating experience. Few documentation, not many tutorials - and the best ones usually don’t work anymore because they use deprecated features… what about legacy, guys?

Even then, I’ve been trying my best to understand this engine which has so much potential. Today, I almost had an orgasm when I came across this youtube video:

https://www.youtube.com/watch?v=VH3etYMjf94

“Wow! It’s exactly what I need right now!”, I thought. I downloaded the latest version of Prefab; then I realized the BSP tool was missing; so I got the older version of Prefab (the one for Away3D 2 or 3).

I did everything exactly as shown in the video. Mind you, I’m using a very simple 3d model - it’s actually simpler than the one in the video.
I exported for Away3D 3.6 (which I have set up in Flash Develop and so far seems to be working correctly), and I clicked in the option for previewing the export.

The preview shown after Prefab exported was good. The movement needed a little tweaking, but everything else looked great…

So then I open Flash Develop, choose the exported .as file as the project document, and, guess what? Right, it wor… no, it didn’t work. I was presented with the blank screen of dispair, which is a view I’ve been seeing too many times since I decided to use Away3D.

So, is there anyone here who cares and may have any ideas on how to solve this issue? Hey, I don’t mind using an older version of Away3D - actually, which version was used in that marvelous video?

   

Avatar
Fabrice Closier, Administrator
Posted: 01 July 2014 12:33 PM   Total Posts: 1260   [ # 1 ]

Today, I almost had an orgasm when I came across this youtube video

ahaha, well I got one the day it worked for first time as well smile

the problem sounds like nothing is addChilded.
add a trident to make sure. and a trace in constructor.

   

alfred, Newbie
Posted: 02 July 2014 04:11 PM   Total Posts: 4   [ # 2 ]

Hello, Fabrice!

Thank you for answering me!
Also, thank you a lot for developing Prefab! It’s a wonderful tool!

After much testing, I finally found out I did a huge mistake.
Can you guess what it was?
Well, my big mistake was…
... to trust Flash Develop.

I decided to try the files exported by Prefab on another computer, which has Adobe Flash Professional installed. So, I used Adobe Flash Pro to compile the SWF and…
Everything worked like a charm.

   

Avatar
Fabrice Closier, Administrator
Posted: 02 July 2014 06:07 PM   Total Posts: 1260   [ # 3 ]

Glad you like the app, (if only I could get more time to work on it..)

If it works in Flash IDE, it surely must run in FD. As I know for sure many used FD for Away 3.x and 2.x projects, it must be related to your setup.
Unfortunately I cannot help you on this side of things as its a PC only program. A quick googling with ‘away3d FD’ gives many results that may help you.

   

alfred, Newbie
Posted: 04 July 2014 11:53 AM   Total Posts: 4   [ # 4 ]

Ah, there’s no need, I’ll just use Flash Pro.

By the way, is it possible to create a BSP tree for a small “outside” area?

I was thinking about modelling a small house with a small yard around it… from what I’ve read, BSP likes closed rooms, so I thought I could enclose this 3D model in a cube with inverted faces, but when I imported the 3D file into PreFab the result was weird and when I tried to generate the BSP tree, my PC almost had an heart attack.

See, I’m looking for someway to automatical-lish detect collision… I’m supposed to model some small wine farms with traditional architecture, and I thought BSP would be the answer, but it may not be that easy… I also thought about AwayPhysics, but I’m not sure…

   

Avatar
Fabrice Closier, Administrator
Posted: 04 July 2014 12:55 PM   Total Posts: 1260   [ # 5 ]

If you invert the faces of the outside world, their normals face away and you introduce errors. While you simply can set a transparent material for this.

For the modelling, technics are similar to printing3D requirements, no holes, and continuous, meaning each and every vertices are connected. In other words, the 3 edges of a triangle must have a neighbour edge sharing same 2 vertices coordinates (not perse same vertex instances, but would be better as its an enclosed shape—> use weld to make sure).

Long ago, I made few FPS projects with this,
http://www.closier.nl/blog/?p=94.(no longer online unfortunately).
here some old dev versions still on my server… flash 10 times smile
http://www.closier.nl/playground/bspdemos/seaproof/
http://www.closier.nl/playground/bspdemos/bunker/
I even still have the very first output David and me made for FITC
http://www.closier.nl/playground/bspdemos/hacienda/

Anyway, If you keep it simple, leave max faces per render between 250 and 1k faces, it will run ok. Above, you will cook the cpu of the client machine.
Even if flash player 11 and higher are slightly better, it’s all cpu and you will not be able to use any dynamic lighting either.

   

alfred, Newbie
Posted: 05 July 2014 04:49 PM   Total Posts: 4   [ # 6 ]

Thank you, Fabrice!
I’ve finally been able to make it!
There’s just one thing which isn’t workig properly…

I’m adding some Collada DAE static objects to the view scene. They show up as expected, however I’m unable to change their material.

In my class declaration, I have:

[Embed(source "mansao.dae"mimeType "application/octet-stream")
  
protected var ColladaModel:Class;

[Embed(source "mansao.png")protected var ColladaMaterial:Class;

protected var 
colladacontainer:ObjectContainer3D Collada.parse(Cast.bytearray(ColladaModel),{autoLoadTexturesfalse}) as ObjectContainer3D

And then under initAway3D(); I have:

var mat:BitmapMaterial = new BitmapMaterial(Cast.bitmap(ColladaMaterial));

_view.scene.addChild(colladacontainer);

colladacontainer.scaleX 300;
colladacontainer.scaleY 300;
colladacontainer.scaleZ 300;
//colladacontainer.material = mat;
for each(var object:Object3D in colladacontainer.children)
{
var mesh:Mesh object as Mesh;
mesh.material mat;

It’s seems it doesn’t give a damn whether I tell it to change the material property or not. It always shows the 3D model with a grey material (I supposed it’s the lambert material from Maya).
I’ve already tried changing the material of the container and the material of the child mesh, but it never works.

EDIT: I found the solution myself!
Instead of changing the material property of the object3d container, what I needed to do was to change the material inside the material libray, like this:

colladacontainer.materialLibrary.getMaterial("lambert1").material mat

Where “mat” is the variable with the bitmap material and “lambert1” is the original material’s name written inside the collada DAE file.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X