Jump to content

Plane Outline?


Recommended Posts

I'm needing to create a outline on a mesh, and in this case a plane! How does one doeth such a thing? :D


And since I hate making millions of posts, how does one subdivide a plane mesh? I tried the function subdivide, but it doesn't seem to do what I want! :D I'm wanting to do what a heightmap looks like, but being a plane... and not a height map!



Link to comment
Share on other sites

Speaking of created grounds... http://www.babylonjs.com/playground/#8ULNX#17


Here you will see two grounds created...  one in wireframe mode, and one with a .showBoundingBox = true.  So, mesh.showBoundingBox is ONE way to outline a plane.  BoundingBoxes have a strange trait.  Their lines can be seen through other meshes.  This makes them handy for SOME applications, and unusable for some others.


Another way:  I stole this demo from Xeonzinc (with a Deltakosh tweak).   It was used to illustrate some action manager testing.  If you mouseover the upright plane or the sphere, you will see another way to outline a plane (or sphere).... mesh.renderOutline = true;  There are also .renderOutlineWidth and .renderOutlineColor to play-with.  The blue plane is actually an outline placed upon the wireframe ground... without needing a mouseover.  Notice that it creates a unique offset plane to do the outline.  There may be more parameters to 'outline' than just color and width.  It is a new feature and I have not studied it.


One more way:  You can make 4 "strips" of plane... using CreatePlane and then scaling the plane to be long and thin, or using CreateGround ("strip", 10, 0.1, 1, scene), and then surround your main plane... with these 4 little strips of plane/ground.  (like a picture frame)  When you click-on/click-off your main plane (your ground), you can toggle their visibility on/off.  You are toggling the picture frame.  :)


There may be other ways, too, of course.  Notice that I placed the wireframed ground just above the other ground.  Since there is no such thing as 50% wireframe, it might be wise to place a wireframed ground atop your normal ground while you are sculpting mountains (probably with the obscure and possibly-yet-uncoded CreateHeightMapGroundFromArray function).  See http://www.html5gamedevs.com/topic/5923-creategroundfromheightmap-use-2d-array-instead-of-image-url/  (dunno the status of "next version" comment from DK).


Lets say you DID start growing mountains from an array full of height values.  You might want to put the wireframe ground atop the solid ground... so you can see the vertex points of the subdivisions... and more easily "watch" your sculpting.  In other words, apply the heightMap array to both grounds... the solid one and the wireframe one.  Then when you are done playing with the mountains, you can simply remove the wireframe ground, or make it invisible.  This is a way to accomplish 50% wireframe on any mesh.


http://www.babylonjs.com/playground/#1D6MP7#2 has a sphere that uses this wireframe-atop-solid trick... which Deltakosh taught me long ago.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...