# Sparky

Members

22

• Rank
Member

## Contact Methods

@sparkygreens
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!