Sprite3D Line

Software: Away3D 4.x

Avatar
SharpEdge, Member
Posted: 05 September 2013 12:48 PM   Total Posts: 94

I’m trying to render a LineSegment as a Sprite3D, i’ve extended SegmentSet and overridden updateTransform() and getRenderSceneTransform(camera:Camera3D):Matrix3D
using the code from sprite3D
this way:

override protected function updateTransform():void
  {
   super
.updateTransform();
   
_transform.prependScale(_width_heightMath.max(_width_height));
  
}
  
  override 
public function getRenderSceneTransform(camera:Camera3D):Matrix3D
  {
   
var comps:Vector.<Vector3D> = camera.sceneTransform.decompose();
   var 
scale:Vector3D comps[2];
   
comps[0] scenePosition;
   
scale._width*_scaleX;
   
scale._height*_scaleY;
   
_spriteMatrix.recompose(comps);
   return 
_spriteMatrix;
  

But the line continues to be rendered in 3d.
What else i need to do?
I’m on the right track?
The SegmentPass needs to be edited?

   

John Brookes, Moderator
Posted: 05 September 2013 02:21 PM   Total Posts: 732   [ # 1 ]

Random guess maybe…

 

File Attachments
SpriteSeg.as  (File Size: 1KB - Downloads: 289)
   

Avatar
SharpEdge, Member
Posted: 05 September 2013 02:38 PM   Total Posts: 94   [ # 2 ]

You are my hero!
The problem was _spriteMatrix, after changing it to sceneTransform all started working.

If it’s so easy to implement, why doesn’t exist some sort of SpriteSeg in the official lib?

OT: Can you tell me how bad is my english (i’m from Italy and i’m just curious to listen the opinion of an english person)

 

   

justinbryce, Newbie
Posted: 07 September 2013 06:05 AM   Total Posts: 2   [ # 3 ]

Hey I am also going to render a LineSegment but not getting from where to start can you please guide me from where to start.


—————————————————————————————
Tell me more on additive manufacturing metal.

 

   

justinbryce, Newbie
Posted: 07 September 2013 06:05 AM   Total Posts: 2   [ # 4 ]

Can you please tell me what spriteMatrix exactly means.

 

   

elemmiki, Newbie
Posted: 07 September 2013 11:52 AM   Total Posts: 10   [ # 5 ]

OT: Your English is perfectly fine wink

 

   

Avatar
SharpEdge, Member
Posted: 07 September 2013 12:26 PM   Total Posts: 94   [ # 6 ]

OT: @elemmiki thank you for your feedback.

@justinbryce: this topic is to talk about the render of a line as a Sprite3D, if you want to render a normal 3D line you should create a SegmentSet, adding to it all your lineSegments and finally add it to your scene.

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X