# Sparky

Members

22

1. ## Projecting onto a sphere

Ha, glad you like it Wingnut. I think it will be super-cool, especially in BJS . I'm struggling to find the right techniques and formulas for a diamond grid at the moment. I've found one, but it's in chinese and the google translation is poor. Everyone is too keen on triangles!
2. ## Projecting onto a sphere

For comparison, Andy uses these for a isocahedron: var phi = (1.0 + Math.sqrt(5.0)) / 2.0; var du = 1.0 / Math.sqrt(phi * phi + 1.0); var dv = phi * du; nodes = [ { p: new Vector3(0, +dv, +du), e: [], f: [] }, { p: new Vector3(0, +dv, -du), e: [], f: [] }, { p: new Vector3(0, -dv, +du), e: [], f: [] }, { p: new Vector3(0, -dv, -du), e: [], f: [] }, { p: new Vector3(+du, 0, +dv), e: [], f: [] }, { p: new Vector3(-du, 0, +dv), e: [], f: [] }, { p: new Vector3(+du, 0, -dv), e: [], f: [] }, { p: new Vector3(-du, 0, -dv), e: [], f: [] }, { p: new Vector3(+dv, +du, 0), e: [], f: [] }, { p: new Vector3(+dv, -du, 0), e: [], f: [] }, { p: new Vector3(-dv, +du, 0), e: [], f: [] }, { p: new Vector3(-dv, -du, 0), e: [], f: [] }, ];
3. ## Projecting onto a sphere

Thanks Wingnut, that looks interesting. Same for the link you posted jerome. I'm staying here for the party, I'm just considering pre-drinks at three to help me get my head around it . I'm really not that hot on 3D stuff, but would be happy to contribute if I manage to do something useful! I've found a couple of articles with fancy maths, here's the one that started me on this road: https://experilous.com/1/blog/post/procedural-planet-generation What Andy has done is great, but I'm put off by the hexagons as it's difficult to have varying levels of detail with hex's as one set of hexes don't sit nicely within another, hence looking at the diamond option. So far I'm basking in a maths headache trying to understand the methods Andy has used, particularly slerp() and subdividing a icosahedron on a spherical plane. Although I'm starting to find my way out of that. I'd be interested to understand how the subdivision of a sphere works in BJS at the moment as that might help. (I'll dig out the code later) Also, I don't quite understand the notation used defining the vertices for a shape as per the preparatory json link jerome posted. Am I right in thinking its defining each vertex as an offset from 0,0,0? (Told you I'm a 3d noob!) Thanks again for all your help. P.s wheat thins? (I'm a Brit - never heard of them)
4. ## Projecting onto a sphere

Thanks jerome (and apologies for mistyping your name the first time . They may well exist by the time I need them. For now I'll have a go at three.js to start me off. What I'm ultimately doing after this bit can be done in BJS easily. Is there anything like that planned for future releases yet?
5. ## Projecting onto a sphere

Hi jermone, That's good to know. Assuming BJS gets regular polyhedrons soon, is there anything bakes into BJS at the moment that would allow me to distort them into a sphere or to subdivide it's faces? Or perhaps another approach would be to start with a mesh of 4 diamonds (i.e. a flattened out octahedron, subdivided or otherwise) and bend it round a sphere like you would a texture? Ultimately I need to be able to perform actions on the diamonds separately after/before they are made into s sphere. They will essentially be tiles on a world.
6. ## Projecting onto a sphere

Hi Raanan, Perhaps I didn't explain it very well, I wasn't sure exactly how to phrase it. I want a sphere that's made up of subdivided diamonds, starting with an octahedron. As in this article: http://www.isprs.org/proceedings/XXXVI/4-W6/papers/267-270JianjunBai-A042.pdf I've seen something similar done with three.js but not quite sure of the methods used (the example using three started with an icosahedron and subdivided to triangles). But basically, an octahedron (that will be further subdivided) bent into the shape of a sphere.
7. ## Projecting onto a sphere

ive had a look through the docs and can't find the answer. How would I go about creating an octahedron and projecting it onto sphere? Thanks!
8. ## New documentation!

I'm not likely to get involved in the updating of the docs, but they certainly look better! Wish the main site had a menu at the top (read: not at the bottom). I'm on a Mac at work and the dock gets in the way!

Ah ok, are you building something first person then? I'm looking at at RTS, so could end up with a lot of meshes, which from what i've read, can be problematic and cause performance issues, hence the merging. You can get around the manipulation by keeping data and un-merging when needed in order to manipulate, then re-merge. These evens would be reasonably rare for me such as building something, so I wouldn't need it to be super-real-time as you might with say, picking up a cup.

Thanks Red, What I had been looking at (from another forum members suggestion) was generating the map and then sectioning it off into merged meshes. Once I have the merged meshes, I'll save those out so I can just load a section of map (terrain, buildings and any other static elements) as required once visible to the user. If I'm understanding you correctly, your approach is to save out each map square/building/whatever else and load in a regions worth when required, which you'll then merge once it's all client side, is that right? Your approach would certainly be easier to manage across multiple users, but more work for babylon (as you'd be repeatedly merging the meshes. Not sure which is the best way to go.

Cheers red, I'll take a look at the code. Much appreciated!

Thanks Reddozen, That sounds pretty sensible. I'm just not sure what incremental loading is for then if I can't use it for that. But if what you're saying will work, then that's all good for me .

Didn't notice the bit about the GeometryID and the snippet about the incremental format in that thread. I'll have a play with that .

Yes, I've read that one. It links to source code for what looks like a C# project. It doesn't seem to have the spec for the .incremental.babylon files etc, which would be helpful (unless I've missed something). I'm not going to have those incremental files pre-built, so it doesn't look like that will be useful. I could always fight my way thought and refactor the code, but I was hoping that there was another option as I don't have Visual Studio on my home dev machine.

Thanks. Yeh, by block, I mean a merged mesh. How would that work with incremental loading though? Do we know if will be able to save out to a .incremental.babylon or just a .babylon? I can't seem to find any spec that states the difference between the two.

Hi, I was just wondering how, in theory, you could incrementally load part of a scene that is changed in game and saved out? i.e. Load map, build things, save map. I've read the docs and seen that there is a way to do incremental loading, but that is using a piece of software that I won't have on the server. Can I save out the blocks of the scene into a certain json format? Thanks for your help
18. ## Creating a persistent map/world

Hi All, So I'm working on my first game idea. I'm currently working on the basics of my game world in browser and am thinking ahead a little here. I'm going to be using a persistent world, shared by all players, I understand the various ins and outs of a persistent game world, but what I'm struggling to decide is; what's the best approach for creating the persistent world/map in the first place. Options I've considered: Build a level builder that can create the world in the DBManually in the DBProcedurally create the world using a script that creates the world in the DBI appreciate that elements of all three are probably useful, but what does everyone else do and have I missed anything? Might be worth me pointing out that my game will have a vaguely tile based map, although I haven't fully decided on the implementation yet. But there will be various squares with different resources, terrain etc. Thanks for your help!
19. ## Map Grid

Yeh, I got the little vehicles running about, but they stopped and I've no idea why! They are cool though! Cheers, have been looking at the docs, just when you're new to this, working out which bit to read is the hardest step . It's like a whole new vocabulary. I'm sure after a flick through your code and the doc's for the bits you've used, I'll be flying . Then I can give my server buddy a nudge to get his end up and running so I can start sending him data.
20. ## Map Grid

Good to know, being a multiplayer, I want to have a fairly large map. I'm hoping only loading visibile parts of the scene will help with that. For now I really just need a workable test world that I can use to build on my ideas for how the multiplayer works and then I'll go back to the game world and optimise that once my 3D buddy has had time to put some buildings etc together. I had a bit more of a go on your game, it's cool, love the vehicles. I just couldn't figure out what to do! I guess that's just the joys of a demo. Makes you realise how useful the first-use tutorials really are! P.S> Love the construction animation .
21. ## Map Grid

Hi jahow, Thanks for sharing, I'm going for a completely different MO, but the general gameplay will share a lot of features with what you're building (managing resources, buildings etc). I'm going for a more co-op vibe where it's all about the player interaction. What you've built so far looks great, I'm definitely going to have a play when I get home from work and see what you've managed to get going so far. Should be a great help to me, thanks! I'd be keen to hear whatever detail you've got, I'm desperately trying to get the babylon side of things to the state where I can start talking to a server and this work on the co-op mechanics. I'll have a look at your code and see if I can figure out the cells approach. Cheers!
22. ## Map Grid

Hi, First of all, I'm new to WebGL and Babylon, so apologies for any noobisms. Basically, i'm trying my hand at an RTS, I've done a bunch of reading on Babylon and at the moment I'm just getting to grips with some of the basics. My plan is to get a very simple world in babylon that I can use to test and code some of the game mechanics. I've so far created a simple world with a heightmap and texture as per the example in the tutorials. Where I'm struggling is how to approach setting that world to a grid. So any buildings etc have to snap to grid when being placed. I'll also want to be able to detect clicks on grid squares so I can display information about what's there, resources etc. Really, I'm just looking for help with approach here. Should I be looking at a tiled ground? (I'm not sure how that would work, splitting up the height map image etc.) or should all the work be done with the detection of the mouse cursor and the grid can just be aesthetic only? Thanks for any help you can give! (p,s> I've also looked at a bunch of examples, but haven't yet found anything that does what i'm after).