RoliMoli, Newbie Posted: 08 May 2013 04:18 PM Total Posts: 10
i hope you can help me.
i want to create a 3d view of a building in flash same this http://dotnetboy.zgig.ir/p1.jpg
of course i want to be dynamic.for example user can zoom and rotate camera view.
can i do it with flash 3d libraries?
if yes which is the best?
if no what is your idea?
of course i should to say that i using pv3d now but have a problem with it:
i want to draw a room view but output is: http://dotnetboy.zgig.ir/out.jpg
why?
this is my code:
public var view:Viewport3D; public var renderer:BasicRenderEngine; public var scene:Scene3D; public var cube:Cube; public var cam:Camera3D;
public function Main() {
var grayMaterial : ColorMaterial=new ColorMaterial(0x33cc99); var materialList:MaterialsList=new MaterialsList(); materialList.addMaterial(grayMaterial,"front"); materialList.addMaterial(grayMaterial,'back'); materialList.addMaterial(grayMaterial,'left'); materialList.addMaterial(grayMaterial,'right'); materialList.addMaterial(grayMaterial,'top'); materialList.addMaterial(grayMaterial,'bottom');
var Material2 : ColorMaterial=new ColorMaterial(0x99cc33); var materialList2:MaterialsList=new MaterialsList(); materialList2.addMaterial(Material2,"front"); materialList2.addMaterial(Material2,'back'); materialList2.addMaterial(Material2,'left'); materialList2.addMaterial(Material2,'right'); materialList2.addMaterial(Material2,'top'); materialList2.addMaterial(Material2,'bottom');
//movie material //var logoMaterial:MovieMaterial = new MovieMaterial( new myMovie() ); // //replace "ActiveTutsLogo" above with the Class name of your movie clip // var materialsList:MaterialsList = new MaterialsList(); // materialsList.addMaterial( logoMaterial, "front" ); // materialsList.addMaterial( logoMaterial, "back" ); // materialsList.addMaterial( logoMaterial, "left" ); // materialsList.addMaterial( logoMaterial, "right" ); // materialsList.addMaterial( logoMaterial, "top" ); // materialsList.addMaterial( logoMaterial, "bottom" );
scene = new Scene3D();
//new drawing var backCube:Cube=new Cube(materialList,800,25,500); backCube.x=0; backCube.y=0;
var bottomCube :Cube=new Cube(materialList2,800,500,25); bottomCube.y=-250;
//bottomCube.rotationX=80;
var topCube :Cube=new Cube(materialList2,800,500,25); topCube.y=250;
var rightCube :Cube=new Cube(materialList,25,500,500); //topCube.rotationX=100; rightCube.x=400;
var leftCube:Cube=new Cube(materialList,25,500,500); //leftCube.rotationX=0; // leftCube.rotationY=0; // leftCube.rotationZ=0; leftCube.x=-400; //leftCube.y=250;
RoliMoli, Newbie Posted: 10 May 2013 02:52 PM Total Posts: 10
[ # 2 ]
hi 80prozent.
very thank for answer.
i test it certainly.
do you read my request.please recheck it and tell me which library is bet.
if i had any question about away3d or pv3d which resources are bet?
80prozent, Sr. Member Posted: 10 May 2013 03:28 PM Total Posts: 430
[ # 3 ]
Hi again
ok.
what you want to do, you can do with all versions of Away3d.
forget about pv3d. this forum is about away3d.
Wich version of Away3d you should use really depends on the platforms that you are targeting.
there is Away3d 4.x that is using FlashPlayer 11.x
and there is Away3d 3.6 that is using FlashPlayer 10.x
Away3d 4.x makes use of the Stage3D, and offers much better performance than Away3d 3.6.
RoliMoli, Newbie Posted: 11 May 2013 01:30 PM Total Posts: 10
[ # 4 ]
hi friend.
thanks.
i say again:
i want to create a 3d view of a building in flash same this http://dotnetboy.zgig.ir/p1.jpg
of course i want to be dynamic.for example user can zoom and rotate camera view.
can i do it with flash 3d libraries?
if yes which is the best?
if no what is your idea?
just want to konw this.
i am new in away3d .but have problem by installing it in flashcs6.
thanks….
80prozent, Sr. Member Posted: 12 May 2013 12:27 PM Total Posts: 430
[ # 5 ]
hi again.
OK here is the very simple answer:
YES - you can use Away3d for your project.
YES - in Away3D you can animate your camera
YES - you can make it look similar to your example
I would use the Away3d 4.1.1 version, thats available for download in the download section (see link in my previoius post)
To get this working in CS6, try finding a tutorial how to set up Away3d in CS6.
If you are on Windows, i would not use CS6 at all, but use FlashDevelop.
FlashDevelop is much better than CS6 for coding as3.
If you are on windows, and are willing to use Flashdevelop, i can tell you how to set up Away3d in Flashdevelop.
If you are not on windows, i cannot help you
cheers
robin
RoliMoli, Newbie Posted: 12 May 2013 01:17 PM Total Posts: 10
[ # 6 ]
hi robin.
first thanks for your answers.
then i can using away3d 4.ok.
now i can work with away 3d 4 in flash cs6. don’t exist any problem.of course i should test flash develop that you said certainly.
but how can i drawing building and it’s room structures? for example when i want to draw a room (rooms have not up sides mean those are a cube that have not up side) , how should i draw it. i found any tuts but more of them was a cube that textured with a bitmap image for all sides. i think MaterialList isn,‘t in away3d 4. know you, i don’t understand which way i should use for draw a room cubes and building structure.exactly same pic that i said.
i want to draw five seperate cube(for bottom,front,back,left,right sides) but
was very difficult joining them together.
a room is a cube or a room is five cubes join together?
when i want do animates, should move camera or move/rotate objects?
what is your idea?
bist bald….
80prozent, Sr. Member Posted: 12 May 2013 02:26 PM Total Posts: 430
[ # 7 ]
hi
the creation of the builing by code would be very difficult.
You will need to use some kind of 3d-application (c4d/3dsMax/Blender/Maya) to create you building.
After you created your Building in a 3d-Application, you can export it and load it into AwayBuilder or Prefab to prepare for use in Away3d.
For a project like this, i think it makes sense to have a static building and a moving camera.
RoliMoli, Newbie Posted: 14 May 2013 06:50 PM Total Posts: 10
[ # 8 ]
hi.
what do you think about this? i working it as this figure. http://dotnetboy.zgig.ir/my.jpg
is good? or ...?
have you any idea for this case? please tell me any resource or same work if you know.
thanks
specially robin.
Fabrice Closier, Administrator Posted: 14 May 2013 08:54 PM Total Posts: 1265
[ # 9 ]
Just a little note “en passant”, know that there are classes in extrusion package that might interrest you. Not only they would simplify your work by doing all the constructs, but they’ll also map the uv’s for you.
For instance, passing the base 4 points and top 4 to SkinExtrude, would build all the sides for you right away. No need to work at triangle level…
RoliMoli, Newbie Posted: 15 May 2013 09:52 AM Total Posts: 10
[ # 10 ]
hi friend.
i don’t understand your mean. please describe me more.what is extrusion package? what is skinExtrude?
thank you….
Fabrice Closier, Administrator Posted: 15 May 2013 10:43 AM Total Posts: 1265
[ # 11 ]
SkinExtrude, generates a mesh from start and end points.
RoliMoli, Newbie Posted: 16 May 2013 07:11 AM Total Posts: 10
[ # 12 ]
hi.
thank.
i found about extrusions on google but some of them were for away 3.6 or older some of them get depracted error.
can you write sample of using extrusions in away3d 4?
i don’t know how using it really.
....
RoliMoli, Newbie Posted: 18 May 2013 12:22 PM Total Posts: 10
[ # 13 ]
i found about pathextrude.
and write any code. my code is:
[SWF(width=800,height=600,frameRate=60,backgroundColor=0xFFFFFF)] public class TestExtrusion extends Sprite{
private var view:View3D; private var scene:Scene3D; private var cam:Camera3D; private var cubePath:CubicPath;
public function TestExtrusion() { //seup my scene view=new View3D(); scene=view.scene; cam=view.camera; addChild(view); init();
}
private function init():void{ var aPoints = []; //here a U form aPoints.push(new Vector3D(-100, 0, 0)); aPoints.push(new Vector3D(-50, 0, 0)); aPoints.push(new Vector3D(-50, -50, 0)); aPoints.push(new Vector3D(0, -50, 0)); aPoints.push(new Vector3D(50, -50, 0)); aPoints.push(new Vector3D(50, 0, 0)); aPoints.push(new Vector3D(100, 0, 0));
var pathData:Vector.<Vector3D> = Vector.<Vector3D>([ new Vector3D(-500, 0,0), new Vector3D(-250, 100,0), new Vector3D(250, 100,0), new Vector3D(500, 0,0),
new Vector3D(500, 0,0), new Vector3D(750, -100,0), new Vector3D(850, -100,0), new Vector3D(1000, 0,0) ]);
var profile:Vector.<Vector3D> = Vector.<Vector3D>([new Vector3D(-100, -50, 0), new Vector3D(-100, 50, 0), new Vector3D(0, 50, 0), new Vector3D(100, 50, 0), new Vector3D(100, 0, 0), new Vector3D(100, -50, 0), new Vector3D(0, -50, 0), new Vector3D(-100, -50, 0) ]);
var mat:ColorMaterial=new ColorMaterial(0xFF0000);
cubePath=new CubicPath(pathData);
var pe=new PathExtrude(mat,cubePath,profile,10); pe.coverSegment=true; pe.smoothSurface=true;
scene.addChild(pe); view.render();
}
}
}
but get me these error from PathExtrude.as file:
Warning: 3602: ‘getPointsOnCurvePerSegment’ has been deprecated.
Warning: 3602: ‘getSegmentAt’ has been deprecated.
Warning: 3602: ‘numSegments’ has been deprecated.
Warning: 3602: ‘getPointsOnCurvePerSegment’ has been deprecated.
Warning: 3602: ‘numSegments’ has been deprecated.
what is problem?
ween i get this errors on C#.net i understand that this class is obsolete.
but it was just a warning no error.
but here i don’t see output.
is that’s mean here too?
RoliMoli, Newbie Posted: 19 May 2013 07:05 PM Total Posts: 10
[ # 14 ]
i try to draw it with extrudes.
my tries is this : http://dotnetboy.zgig.ir/draw.jpg
two side with 90 degree i drawn by linearExtrude and the arc side i drawn by
pathExtrude.
the code lines are :
[SWF(width=800,height=600,frameRate=60,backgroundColor=0xFFFFFF)] public class TestExtrusion extends Sprite{
private var view:View3D; private var scene:Scene3D; private var cam:Camera3D; private var cubePath:CubicPath; private var pe:PathExtrude; private var le:LinearExtrude; private var lastKey:uint; private var keyIsDown:Boolean = false;
private var hoverCam:HoverController;
public function TestExtrusion() { //seup my scene view=new View3D(); scene=view.scene; cam=view.camera; cam.z=-800;
addChild(view); init();
}
private function init():void{
var lineData:Vector.<Vector3D> = Vector.<Vector3D>([ new Vector3D(0,0,0), new Vector3D(0,-100,0), new Vector3D(-100,-100,0)
]);
var pathData:Vector.<Vector3D> = Vector.<Vector3D>([
new Vector3D(0,0,0), new Vector3D(-100,0,0), new Vector3D(-100,-100,0)
]);
var profile:Vector.<Vector3D> = Vector.<Vector3D>([
new Vector3D(-50, -10, 0), new Vector3D(-50, 10, 0), new Vector3D(0, 10, 0), new Vector3D(50, 10, 0), new Vector3D(50, 0, 0), new Vector3D(50, -10, 0), new Vector3D(0, -10, 0), new Vector3D(-50, -10, 0) ]);
var mat:ColorMaterial=new ColorMaterial(0xFF0000);
var qPath=new QuadraticPath(pathData); pe=new PathExtrude(mat,qPath,profile,10,true); pe.z=50; le=new LinearExtrude(mat,lineData,LinearExtrude.Z_AXIS,100,20,true,5,3,null,false,false);
if(keyIsDown){ // if the key is still pressed, just keep on moving switch(lastKey){ case 87 : hoverCam.tiltAngle -= 2; break; case 83 : hoverCam.tiltAngle += 2; break; case 65 : hoverCam.panAngle -= 2; break; case 68 : hoverCam.panAngle += 2; break; case Keyboard.UP : hoverCam.distance -= 5; break; case Keyboard.DOWN : hoverCam.distance += 5; break; }
}
view.render(); }
private function kd(e:KeyboardEvent):void { lastKey = e.keyCode;
if you see the result(http://dotnetboy.zgig.ir/draw.jpg), you can see arc line thickness have problem.i signed they with two white circles.
first question : is this true way to drawing my requested shape(http://dotnetboy.zgig.ir/req.jpg)?
and second : how can i solve thickness of arc line side same two lineaerExtrude lines?
thanks for your time….