« first day (1669 days earlier)      last day (3354 days later) » 

Pip
5:08 PM
god damnit why the faq are clicks not registering :/
It has to be a Monogame thing but... omfg why
I thought I broke my pathfinding, but nope, for whatever reason clicks aren't working
Why does working code have to take a shit on me and not work for NO REASON
@Wardy And Monogame/XNA
but yeah, that's fairly correct
 
@Pip the answer to this is literally the next thing you wrote
 
Pip
sh, you
I really like Monogame and it works
(most of the time)
 
lol
 
Pip
Roadblock #2 :/
 
welcome to the clueless club
 
Pip
5:18 PM
Yesterday I spent 4 hours trying to figure out why I couldn't deserialize some XML into an object, only to realize after all of that time I was trying to do something stupid
I was trying to save the file every time I set a property
so I was trying to save to that xml file while reading it :/
 
ok thats retarded lol
maybe you should get some sort of award for worst noob mistake a programmer ever made lol
 
yay I can login and logout of my number game on phone
next step: register guest account
@Pip hahah I hate when I make mistakes like this
 
uh oh looks like @Almo is after lifetime achievement award for worlds nuttiest programmer lol
 
hahah :)
 
5:33 PM
0
Q: How to get a position from a radial distance and angles?

WardyI have a radius and the 2 angles for northSouth and eastWest rotations in degrees. I need a Spherical position or a cartesian position (I have code translate one to the other) Where a position is defined as one of the following ... class Vector { public float x; // distance along x axis p...

apparently this is really hard to figure out
 
guys do you know where I can find some crappy filler textures preferably for free?
 
this should do thanks :)
Wardy I am not sure what's the problem with the coordinates
 
it may just be my understanding of spherical positioning
for example would you say this sounds correct ...
class SphericalPosition {
   public float radius;       // distance from center
   public float azimuth;      // distance from 0 degrees around polar axis
   public float inclination;  // distance up from equator (x,z plane)
}
"polar axis" meaning in unity's case the y axis (up and down)
x,z obviously being the other two so the floor could be described as an x,z plane
Whereas what I have is defined as ...
class PolarPos
{
   public float radius;         // distance from center
   public float AngleUpDown;    // rotation of x,z plane
   public float AngleLeftRight; // rotation round y axis
}
I think the problem is that I don't understand the SphericalPosition correctly and thus it may be what I see as a PolarPos (problem solved) or I need to do some pythagorus / trig to get Spherical from Polar
@Veritas does that make sense?
 
Why do you need polar coordinates?
the spherical coordinates look fine
polar only needs one angle
and it's for 2d
 
5:46 PM
my code is 3d
I have a region defined as ...
public class PlanetRegion
{
    public float North { get; set; }
    public float South { get; set; }
    public float West { get; set; }
    public float East { get; set; }
}
all these values are angles
they are needed by the noise modules to generate spherical noise
 
you need 4 angles?
 
now I have my noise texture I need to generate a mesh
@Veritas they are basically pairs
 
yep got it
 
north west + radius = point 1
south east + radius = point 2
noise generates texture for that region
then I need to tell my meshing code "now create this portion of a sphere as a mesh to render the texture on"
makes sense ?
I have a unity script that looks something like this ...
 
6:01 PM
You want to generate the verts from the height map ?
 
when i get closer in yes but at this point I will basically just be generating a portion of a perfect sphere
 
So you just want to create a part of a sphere mesh procedurally ?
 
essentially yes
but the part of the spheres is defined as radius + region info
you with me ?
 
yep
 
for(northwest + radius ; southeast + radius ; step)
  place vertex
so i need to get from (north, west, radius) to (x,y,z)
then i have the rediculous problem of figuring out the uv coords too
then as I get closer to the mesh the idea is to split each edge (double up the verts) to add more detail
then start distortion of the points (based on heightmap values )
but that can come later
for now I just want to figure out the absolute basics of defining a region on the sphere and building it as if its a perfect sphere
 
6:14 PM
@Wardy I dunno if it's of any help, but Accidental Noise has a function for generating spheres in 2, 3, 4 and 6 dimensions.
 
I have the noise problem sorted im using libnoise
the issue is generating the mesh
 
i can't get my head round the mechanics of spherical mesh construction
 
12
Q: procedurally generate a sphere mesh

clampi am looking for an algorithm ( in pseudo code) that generates the 3d coordinates of a sphere mesh like this: the number of horizontal and lateral slices should be configurable thanks a lot in advance!

This could be a good first step
 
until now all my planet stuff has been using unity's built in sphere objects
@Veritas I saw that and got confused ... also I need to not generate a whole sphere only a part of a sphere
the idea is to break down the sphere construction in to chunks
 
6:17 PM
which is why I said it's a good first step. I think I can come up with an algorithm for specific sphere parts but I am very busy at the moment. I'll come back to you later.
 
@Veritas k thx :)
what is it about pi
i never got that
like why is the value 3.141... so important ?
and so correct!
 
The unit in the gif is the radius of the circle
 
ah circular math
such a head smashing exploit
 
6:33 PM
this should generate the verts for half a sphere :
for φ = -pi/2; φ < pi/2; φ += angle_step:
for θ = -pi/2; θ +pi/2; θ += angle_step:
(x, y, z) = (Rsinθcosφ, Rsinθsinφ, Rcosθ)
 
I think we have moved away from the original problem
 
If you play with the angles you should be able to create the mesh from a part of a sphere
 
hmmm
@Veritas jeez this makes my eyes glaze over
I don't get math notation
 
just take the x,y,z notation for granted
R is the radius
 
for azimuth
  for inclination
    (x, y, z) = (Rsinθcosφ, Rsinθsinφ, Rcosθ)
but i don't have those values
I have radius and 2 angles
hense my question about how to get those values
 
6:43 PM
θ and φ are also angles
you just have to map your angles to them
oh wait you only have 2 angles?
how do you define a region with 2 angles?
 
I have degrees
degrees north, south, east, and west
if i take north and east and the radius i get a point
so lets say i go 45 degrees north and -45 degrees east then the radius of the planet I have a point somewhere in the top left section of the planet
make sense?
 
yes but that's a point not a region
 
right but regions have north, south, east and west
i also know the radius
 
let me check one minute I think I got it
 
so if i take north west and south east i have 2 points
diagonal
i can then do the same on the other diagonal and i have a quad
the corner points of my regoin
 
6:54 PM
final try:
for φ = -west; φ < east, φ+=pi/180;
for θ = -south; θ < north; θ += pi/180;
(x, y, z) = (Rsin(pi/2-θ)cosφ, Rsin(pi/2-θ)sinφ, Rcos(pi/2-θ))
 
so that loop has 180 degree steps ?
if i understand this code correctly then φ is considered an angle?
and so is θ
 
yep in radians
 
ok this is where I got lost in the math
I got the impression from wikipedia that they were distances not angles
that's likely why i got stuck then
 
this explains a lot
 
so by your theory i should be able to go directly from the info i have to a spherical
var northEast = new Spherical(radius, north, east);
 
6:58 PM
yes but it kind of depends from which axis you start measuring
the angles
try to experiment
 
what you mean by that ?
so north and south are rotations of the x,z plane (a flat horizontal plane through the equator)
east and west are rotations around the pole (the y axis, up and down)
 
rotations of which axis?
I mean what's your reference point when defining the regions with angles
 
well I'm basically using whatever 0 is for the noise generator
it starts somewhere then goes round 630 degrees
so i basically grab from 0 degrees to say ... 45 degrees and generate a mesh and the texture for that
it doesn't so much matter what the values are just that the parameters are such that both mesh and texture / heightmap generation are given and see the values as the same thing
 
yep. I think you will figure it out if you play a bit with the angles alone
 
This is the idea ...
the parent (the planet) will set the region and PlanetSize variables
PlanetSize is the radius of the planet
the region as we've talked about represents the area bounds in degrees
 
7:05 PM
When talking about coordinate systems using angles we need to set reference axes from which to count the angles
I am not sure if the noise generates uses the same axes
you will have to experiment a bit
 
ah ok ... from reading through the spherical noise code it looks like the angles are calculated on the x and y axis
 
in that case I think the code example is correct
 
for φ = -west; φ < east, φ+=pi/180;
for θ = -south; θ < north; θ += pi/180;
(x, y, z) = (Rsin(pi/2-θ)cosφ, Rsin(pi/2-θ)sinφ, Rcos(pi/2-θ))
that one ?
 
yes
 
ok
 
7:07 PM
but I'm multitasking so there may be some bugs
 
see if i can get this working as c# code
 
but the idea is pretty much it
 
thx :)
 
np good luck! I'm off
 
Joe
7:37 PM
do we one box videos now? guess not
 
7:49 PM
one box ?
 
Joe
in chat if you link a youtube video it gets a special message display
they were calling it "one box"
 
They never fixed gist one-boxing :(
Yay! I fixed the damn sand!
It now spreads properly :D
It does make some weird movements though. :P
 
@William'MindWorX'Mariager congrats :)
 
@William'MindWorX'Mariager now thats cool !!
 
physx ?
 
All fragment/pixel shader based.
 
oh cool
 
Completely parallel which is nifty.
I wonder how well it would work in 3d on the CPU.
 
hmmm interesting
 
8:01 PM
I wouldn't know where to start to render it though. :P
 
particle system ?
 
That might work yeah.
Just render a particle on each position.
All I need is a way to turn a 3d array into a scene I can view efficiently. I guess I could use Unity.
 
sounds like you need a voxel engine
lol
and a fast one at that
 
Very cool results William!
 
I think so too. It ended up being pretty simple.
user image
4
Hourglass test :D
 
8:11 PM
lookin very nice
 
^
 
8:25 PM
@Veritas i uh ... don't think that worked lol
not quite sure exactly what went wrong there
funky though
 
where ?
im curious
lol
 
The first message is a link.
 
ah cool
thats wierd
 
It is. :P
 
8:42 PM
now that's awesome
 
@Lokkij Looks crazy :P
 
wardy don't you have to take care of the normals?
 
na unity will handle them
im just not making the call yet
want to get the mesh data right
+		result.vertices[0]	"(200.8, 400.6, -894.0)"	UnityEngine.Vector3
+		result.vertices[1]	"(-228.6, 385.4, -894.0)"	UnityEngine.Vector3
+		result.vertices[2]	"(-447.8, 15.9, -894.0)"	UnityEngine.Vector3
+		result.vertices[3]	"(-255.3, -368.2, -894.0)"	UnityEngine.Vector3
+		result.vertices[4]	"(171.9, -413.8, -894.0)"	UnityEngine.Vector3
looks messed up
 
Mixed physics
Dust stacks, fluid spreads.
Dust forces up fluids.
 
haha now that's scene building !!!
 
8:47 PM
Sexy
 
@Veritas so I took your "seudocode" ...
for φ = -west; φ < east, φ+=pi/180;
for θ = -south; θ < north; θ += pi/180;
(x, y, z) = (Rsin(pi/2-θ)cosφ, Rsin(pi/2-θ)sinφ, Rcos(pi/2-θ))
And this is what I came up with ...
var halfPi = Math.PI / 2;
var verts = new List<Vector3>();
int x = 0, y = 0;

for (double az = Region.West; az <= Region.East; az++)
{
    x++;
    y = 0;
    for (double inc = Region.North; inc <= Region.South; inc++)
    {
        verts.Add(new Vector3(
            (float)(PlanetSize * Math.Sin(halfPi - az) * Math.Cos(inc)),
            (float)(PlanetSize * Math.Sin(halfPi - az) * Math.Sin(inc)),
            (float)(PlanetSize * Math.Cos(halfPi - az)))
        );
        y++;
    }
}
PlanetSize is the radius
 
inc += halfPi/2 same for az
but something is definitely wrong
also what's with this?
vert + + x + 1;
 
so im adding verts 1 row at a time
so when building tris using clockwise winding I need to start on the second row
point 1 on the first tri is the first vert on the second row
so the var x tells me how many verts per row
currentVert + x = the same vert on the row below
currentVert = the vert above that
current vert + 1 = the vert next the one above
 
Interactions!
Water turns into plants
 
8:56 PM
Plants burn :D
 
currentVert + x + 1 = the vert next to me on the row below
 
you need water + something turns into plants
 
@William'MindWorX'Mariager thats cool :)
 
that way water can actually exist
 
is it possible to only show the verts?
 
8:56 PM
@SpartanDonut Hehe, yeah. Perhaps seeds or something.
 
@William'MindWorX'Mariager cool as faq
 
Yeah! seeds plants could slowly absorb water and subsequently the plants would grow (as opposed to the stacking that's going on)
 
ok updated @Veritas
very bizzarre
 
oops
 
8:58 PM
lol
 
@SpartanDonut Aye. That could be cool.
 
I meant inc += pi/180
is it possible to only show vertices ?
without edges and faces
 
ooo that breaks it
not sure its unity
hmmm
var step = Math.PI / 180;

for (double az = Region.West; az <= Region.East; az += step)
    for (double inc = Region.North; inc <= Region.South; inc += step)
results in out of mem exception
 
o.o
 
@William'MindWorX'Mariager But seeds and plants can also drown! :O
 
9:03 PM
well that's not the important part
it just basically controls the density
 
@SpartanDonut You're making this complicated :P
 
:D
Do what you want. You're doing awesome regardless.
 
Hehe
It's been a cool challenge. Making it all work in a fragment shader.
 
Another idea lol
 
I'll be throwing it on GitHub soon.
 
9:04 PM
Your sand / dirt can have a wet state. It can absorb so much water before flooding
And dries out over time
 
Should be straight forward to make it work with webgl in a browser. All the speed and still in a browser.
 
nice
 
@SpartanDonut That's interesting. Make it absorb water and above a certain threshold, it'll start acting like a fluid.
 
The water will. Not the dirt.
 
9:06 PM
I don't feel like my typing speed is improving.
 
Plant only burns above a certain temperature, making it burn slower.
 
It even looks like you have the whole heat rises concept in there too
(it burns fast going up than down)
 
@Veritas looks like i would have to write a custom shader to have unity spit out only points for each vert
 
I should learn some webgl and port it. This way I get a better understanding of that as well. I have no clue how the XNA SpriteBatch works. To me it's pure magic. :P
 
9:09 PM
@William'MindWorX'Mariager just spits out an array of sprites to 2d space don't it?
 
ok let's try this
 
@Wardy I guess so.
 
so in theory its no more complex than the winforms library
 
az += (Region.East-Region.West)/5
 
its just rects and textures
 
9:11 PM
inc += (Region.North-Region.South)/5
and try to print the vertices
so we can determine if they belong to the sphere
 
do you need to see them or the values ?
 
The best would be to see them
 
might be able to find a point rendering shader but its not something i can just turn on in unity
 
thought so
which is why I proposed the above
 
that last change is another out of ram exception
 
9:14 PM
why would it be an out of ram exception is beyond me
South-North for inc
 
ah that did it
hmm peculiar placement though
 
(South-North)/5
 
maybe i should start by just adding the 4 corners
see how that comes out
 
can you print the vertices before that?
 
result.vertices[0]	"(200.8, 400.6, -894.0)"
result.vertices[1]	"(433.4, 113.7, -894.0)"
result.vertices[2]	"(371.6, -250.4, -894.0)"
result.vertices[3]	"(57.3, -444.4, -894.0)"
result.vertices[4]	"(-295.9, -336.5, -894.0)"
there's loads more
but thats how it starts
oh actually this time round theres only 36
hmmm
 
9:19 PM
hmm let me check something really fast
 
here's the updated code : hastebin.com/zaxubodowu.avrasm
in case it helps
 
Shit. I just died on a lvl-20 character. On the upside, I've placed 366th, which is pretty good.
 
@Lokkij what game ?
 
@Lokkij y u so bad?
 
9:21 PM
hmmm never heard of it
 
so the radius is 1000
 
yeh it feels like a reasonable size
the region values are:
North = -90, South = 0, West = -90, East = 0
bit backwards but the lower north south the higher you face (anticlockwise rotation on the x axis)
 
wait
these should be in radians
 
nope degrees are the values i have
 
well I said it was radians :P
it's not hard to change it
 
9:25 PM
spose i could convert them to radians
that should be simple math
 
yea try that and let's try again
just multiple with 0.0174
 
something like this may help with debugging
 
cool
hmmm
ok so prior to the loop I added ...
var west = Region.West * 0.0174532925;
var east = Region.East * 0.0174532925;
var north = Region.North * 0.0174532925;
var south = Region.South * 0.0174532925;
then used these instead of the region values
 
alright
 
9:32 PM
i think the normals are going the wrong way but it does appear to be generating a curved set of verts
but they arent quite right
 
can you print the points
?
 
take a look at that
I think the math needs some work for the point calc
or does it
that makes sense right ?
 
9:51 PM
I'm sorry I have to go. You may want to try to read how to plot points into spheres.
It should work the same with vertices
I think you will find more results that way
 
i've got that last sample rendering a single tri
I guess the start is to get that rendering a quad
then go back to the loop to subdevide it
thx for your help though
 
one final act of desperation, it's hard to debug without seeing the code and the results
 
I'll ping you if i beat it
 
remove the pi/2 - part
 
@Veritas I could fire up twitch if you wernt off
these values seem correct
Unless I misunderstood it
 
9:55 PM
hard to say with such few values
 
oh actually I think i see a problem
South = 0, West = -90
evalutates to
(0.0, 0.0, -1000.0)
North = -90, West = -90
same output
 
can you put more vertices so I can plot it?
 
uh yeh if i put this back in to the loop code
I was just trying to get the 4 corner positions correct
 

« first day (1669 days earlier)      last day (3354 days later) »