Poll
What are your thoughts on circles?
They’re so round awesome! 1
I’d prefer a square any day. 0
Total Votes: 1
You must be a logged-in member to vote

 

3D Circle?

Software: Away3D 4.x

Avatar
owntheweb, Jr. Member
Posted: 01 November 2012 06:35 PM   Total Posts: 32

Hey,
Looking at the primitives documentation, I’m guessing there is not a “Circle” you can place in Away3D space. As an alternative, would you recommend a “Polygon” with many sides that looks round, a “CurveLineSegment” to construct a circle somehow (good example out there?), or a “Cylinder” with almost no height (performance issues with a few of these?).

Thanks for the feedback!

   

Avatar
Fabrice Closier, Administrator
Posted: 02 November 2012 09:39 AM   Total Posts: 1265   [ # 1 ]

“there is not a “Circle” you can place in Away3D space.”

Actually you can make “circles” many ways, there is not one better than the other. LatheExtrude for instance let you make “circles” with any profile. A ring, a tire, a plate etc.. also % of a rotation help you to build piecharts, halfpipes, like shapes. Use offsets and add more rotations and enjoy springs like results. PathExtrude could also be used but if you make only 360 rotation, Lathe would be better choice. PathDuplicate coupled to some smart shapes would allow to build fans, vents. RegularPolygon let you build a circular plane the easy way. Using some rotational code, combo with LineSegment or Meshhelper (with custom made polygons) give you other options…

As about performance with a “few” of these. Utils such as Merge or Weld or the upcomming 4.1 geometry improvements will certainly give you a hand in that regard. Also keep in mind that even if we work hard on optimalisations,  your code is still the keyfactor.

   

Avatar
owntheweb, Jr. Member
Posted: 02 November 2012 01:49 PM   Total Posts: 32   [ # 2 ]

Cool!

I’ll definitely look into these and get back. Basically, I’m trying to replace these circles I created as flat sprites in native Flash (CS6) here:
http://www.christopherstevens.cc/sos/kiosk1 (these circles look very flat in those flat sprites!)

I can visualize this working great with line segments after seeing an Away3D demo, but will research some keywords you mentioned for a more smooth approach.

Thanks much,

   

Avatar
owntheweb, Jr. Member
Posted: 03 November 2012 06:57 PM   Total Posts: 32   [ # 3 ]

Success!:
http://www.christopherstevens.cc/sos/kiosk2/ (code below)

The WireframeSphere did the job wonderfully. As a final touch, any thoughts on how to add a fade to black based on depth (fog?)? I want to give increased perception of depth for this interface I’m making.

Thanks!

EDIT: I was able to make a black “fog” by placing in a few mostly transparent black planes - works great for what I need. :D

Code:

package  {
 
 import away3d
.containers.*;
 
import away3d.entities.*;
 
import away3d.materials.*;
 
import away3d.primitives.*;
 
import away3d.utils.*;
 
 
import flash.display.*;
 
import flash.events.*;
 
import flash.geom.Vector3D;
 
 public class 
SphereDial2 extends MovieClip {
  
private var _view:View3D;
  private var 
_sphere:WireframeSphere;
  private var 
_sphereHolder:ObjectContainer3D;
  private var 
_fog:FogMethod;
  
  public function 
SphereDial2() {
   stage
.scaleMode StageScaleMode.NO_SCALE;
   
stage.align StageAlign.TOP_LEFT;
   
   
_view = new View3D();
   
_view.antiAlias 4;
   
addChild(_view);
   
   
_view.camera.= -580;
   
_view.camera.100;
   
_view.camera.lookAt(new Vector3D());
   
   
_sphereHolder = new ObjectContainer3D();
   
_view.scene.addChild(_sphereHolder);
   
   
_sphere = new WireframeSphere(20036180xFFFFFF1);
   
_sphereHolder.addChild(_sphere);
   
   
//setup the render loop
   
addEventListener(Event.ENTER_FRAME_onEnterFrame);
   
stage.addEventListener(Event.RESIZEonResize);
   
onResize();
  
}
  
  
//render loop
  
private function _onEnterFrame(e:Event):void {
   _sphere
.rotationX += 1;
   
_sphere.rotationY += 1;
   
_sphere.rotationZ += 1;
   
   
_view.render();
  
}
  
  
//stage listener for resize events
  
private function onResize(event:Event null):void {
   _view
.width stage.stageWidth;
   
_view.height stage.stageHeight;
  
}
 }
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X