Need advice on materials and culling/frustum issues

Software: Away3D 4.x

Avatar
Dan Baughman, Newbie
Posted: 20 January 2012 08:08 PM   Total Posts: 5

Hello ! I’ve got a couple noob questions. I just found out about away3D about a week ago, and I’m loving it so far. I am, however, experiencing some issues that I can’t seem to resolve on my first scene. I’ll include a link further down the post, but basically, I’m attempting to make a parametric pyramid skylight. I’m doing some fairly simple math to figure out where all the vertices are, then connecting the dots with triangles, some of which end up being very big / long. The problem is (from what I’ve read in other posts / Google searches) that either away3d or flash decides that whenever 2 of the 3 points on a triangle are outside the bounds of the scene, the entire triangle is no longer displayed. So far, the only thing I’ve tried adjusting the .far and .near on my camera lens (did not help) but I really don’t think that’s the problem. Any other suggestions? The second question would be on how to make a “painted metal” looking material, and a glass-like material with what’s currently available on the version 4.0 alpha.

Here’s the link to the work in progress (be gentle, I’ve only been at this for a week wink )

Pyramid Skylight

There’s 3 text fields in the upper left corner: the first is the angle (degrees), the second is the overall size (inches), the third is the number of “bays” (# of rafters). As an example, enter 30, 120, and 16 then zoom in until the rafters start going off the screen to see what I’m talking about. BTW, what you’ll see is only 1/8th of the skylight.
I’m at work, so I don’t have access to my .as file, but I can attach it on a future post if anybody needs to see it.
Any help / suggestions / ideas would be greatly appreciated. Thanks!!!!

   

Avatar
Dan Baughman, Newbie
Posted: 23 January 2012 12:12 AM   Total Posts: 5   [ # 1 ]

Ok, I figured a few things out, so I figured I’d post my findings for others who might be experiencing the same problems… The triangles I was talking about were generated by using the method shown in a thread labeled “Creating a face from vertices?” (can’t add a link or else my post is considered spam).
It works great, with the exception of the issue mentioned in my previous post, and also the fact that creating as many Triangles entities, as I need resulted in the “Error #3691: Resource limit for this resource type exceeded.”
Anyways, I ended up changing how I went about creating my geometry. Instead of generating a ton of individual triangles, I used this approach instead:

var pts:Vector.<Number> = new <Number>[pt0.x,pt0.y,pt0.z,pt1.x,pt1.y,pt1.z,pt2.x,pt2.y,pt2.z,pt3.x,pt3.y,pt3.z,pt4.x,pt4.y,pt4.z,pt5.x,pt5.y,pt5.z,pt6.x,pt6.y,pt6.z,pt7.x,pt7.y,pt7.z,pt8.x,pt8.y,pt8.z,pt9.x,pt9.y,pt9.z];
    var 
idx:Vector.<uint> = new <uint>[0,2,1,1,2,3,6,8,7,7,8,9,6,4,2,8,2,0,2,8,6,3,5,7,3,7,9,3,9,1]
    
var hip1:Mesh MeshHelper.build(pts,idx,null,"hip",_material2,false,true); 

This had two effects: 1) the individual Triangles that were disappearing when they crossed the limits of the scene are now part of a mesh and for whatever reason that problem doesn’t happen on meshes. 2) I have waaaaay fewer entities, so the “Error #3691” problem has been all but eliminated.
Hope this will help other noobs like myself smile Now if I could only figure out the mesh “Merge” thing, I think I could completely eliminate the Error #3691.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X