Why not just use a plane (two polys) with a MovieClip or regular bitmap (png?). The mouse *should detect the parts that are transparent as unclickable, so you can have hundreds of those, quite possibly.
-Pete On Mon, May 3, 2010 at 4:35 PM, CyberHawk <[email protected]> wrote: > I have such a simple problem/issue/question that i can't seem to find > quite the answer to without asking. So, I am using Away3D 3.5 (Latest > as of this question 5-3-10) and for starters all i am trying to do is > create a hexagonal shaped grid using smaller hexagons. The MAIN > purpose for this larger hexagon grid is so you can drag other 3D > objects to it from a list later on and the grid accepts mouse clicks > so you can select the hexagons. > > ----------------------------------------------------------------------------------------------- > I am creating one hexagon shape (Side=6) using the object type > "RegularPolygon", Radius=57, and i am using that as a BASE since i > want to set a color to it, an “alpha= 0.3, ownCanva=true”, to make it > partially transparent so the background show's thru and i need to > create this base object so i can have something solid so i can click > on using the “MouseEvent3D” event. > > Next i create a second hexagon shape (Side=6) using the object type > "WireRegularPolygon", Radius=57 to form an outline to the first "BASE" > hexagon so you can see the hexagon object AND its main purpose is once > you click on the base hexagon, it will change the wire hexagons color > to something else, showing that that hexagon was selected. > > I use a FOR LOOP to generate a larger Hexagon shape using the above > two objects, which is made up of a total of 542 RegularPolygon’s and > 542 WireRegularPolygon’s but would like twice that much or more later > on. > > The reason I would rather generate the grid dynamically is so I can > create different size hexagons or different patterns of them later on. > If I used a hexagon image, I would have to recreate it if I changed > its size or color. > > ----------------------------------------------------------------------------------------------- > MY PROBLEM is that once I make that grid zoomed out all the way so you > can see the entire thing, the "T ELEMENT=3252" and the "R ELEMENT > ranges from 3405 to 3795" depending on how the HoweverCamera3D is > tilted. The RAM is around 50MB to 60MB which does not seem too bad for > now. The FPS at max zoom is around 8 to 10 FPS when you rotate and > till the camera. It is also using FP10 and all coding is done in Adobe > CS4 Suite. I am also using BASIC RENDERING. All hexagons are generated > in a separate AS3 class file which extends ObjectContainer3D and I > create an instance of this class in the MAIN AS3 class file. I have > nothing else on screen but the large hex grid and a static 500x500 JPG > image as the background. > > ALL I am looking to do is make a very lightweight hexagon grid using > ANY 3D Object type that can accept a MouseEvent3D event so I can click > on it, be able to have alpha set (BUT I could do away with that and > make it be 100% transparent), and have an outline that I can later > change its color and thickness to show it was clicked on as this > object serves nothing more than a sort of "stage" for other objects. > Basically, in my view, that hexagon “stage” is suppose to be the LEAST > performance hungry of all other objects to come. > > > ----------------------------------------------------------------------------------------------- > In my first attempt before I started using away3D, i just created each > Hexagon "BASE" using a Sprite object and generating the "OUTLINE" > using a Shape object that you can draw on using the graphics and > drawPath functions and had to actually draw the hexagon shape manually > using lines and sin/cos. > > MY next set of questions would be about if there is a "drawPath()" > function in away3d just like in Flash to draw on sprites and Shape > objects. I did see it, BUT really don't know if it works like the one > in Flash. I also did see a Graphics3D.as file that seems to have > similar functions such as "moveTo" and etc, but i have not seen any > examples on how to use it yet. > > When i just display the outline hexagon SHAPE objects in Flash, i can > create a huge grid, over 1000 objects, and it runs really fast > (meaning can rotate it using rotationY as well as panning without loss > of FPS). But it is not practical to try to click on a wire frame > outline of a hex. Don't know the poly count or RAM usage as that is > created using the native Flash Display objects AND I can't add sprite > or shape objects into any Away3D objects directly, so can't display > them. I have tried and could not figure it out yet BUT if there is a > way that might help a lot as i know those Flash objects being > displayed are much faster on the FPS. > > ----------------------------------------------------------------------------------------------- > I am by no means an expert at away3D or Flash and I started using > Away3D like a month ago and I have to admit it is incredibly awesome > 3D package. I have not yet explored using Line2D or Line3D to draw > the hexagons manually as well as Sprite3D objects for the BASE mouse > event object in away3D but those will be my next things to experiment > with, BUT before I just jump head first into recreating the entire > thing 5 different ways, I would like to know an easy way to generate a > very simple hexagon grid that you can select each smaller hexagons it > is made of, without making the POLY COUNT so enormously large. There > are many ideas as t how to do it, BUT I would rather try using basic > primitive objects available in away3D or something simple with the > least amount of code to try to optimize it. > > Thanks for anyone who can answer my question. > -- ___________________ Actionscript 3.0 Flash 3D Graphics Engine HTTP://AWAY3D.COM
