Jump to content

Voxels in HTML5


Brift
 Share

Recommended Posts

So I have been working on a system of voxels using three.js, and while I do have a working example of what I'm trying to accomplish at http://apoidgames.web44.net/wedge.html I feel like there are a lot of things I could do to make this more efficient.  I adapted the pointerlock control example from three.js to get to this point.

 

To briefly summarize what I am trying to accomplish, I am attempting to create a minecraftlike with the change that the xz plane is composed of equilateral triangles as opposed to squares.  While I was able to render a scene based on whether the blocks are filled or not filled, the way I went about doing it was to create a new mesh for every face that needed to be displayed.  What I would like to do instead is have one mesh for a given area that I add faces to as needed.  Unfortunately I run into problems trying to keep track of vertices and faces in general, and I also need each face to be aware of both the block it represents as well as the block it is facing.

 

I should probably mention that I am relatively new to javascript and it's very possible that I'm going about this the wrong way.  I feel that HTML5 and web is the way of the future though, and so any possible suggestions on how to make this better would greatly be appreciated.

 

Thanks,

Dave (aka. Brift)

Link to comment
Share on other sites

  • 2 weeks later...

So the thing I am worried about when it comes to merging the geometry is that I need to target a particular face in order to either 1 set that block that the face belongs to false (erase the block) or 2. Set the block the face is facing to true (fill the neighbor).  If all of the geometry is merged it's my understanding that I won't be able to pick out faces, though I could be mistaken in that regard.  I'm beginning to think that a voxel engine might be a little too much for a browser.  Thanks for your feedback everyone.

Link to comment
Share on other sites

  • 3 months later...

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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