room topic changed to Game Tech & Internals: All branches of combinatorial optimisation AND AI, Lighting, Scene graph, data structures - you name it. Here [game-design]
@Wardy have you ever read any of the "Game Programming Gems" books, or "AI Programming Wisdom" and co?
room topic changed to Game Tech & Internals: (UNOFFICIAL CHAT) All branches of combinatorial optimisation AND AI, Lighting, Scene graph, data structures - you name it. Here - This chat is not "the official gamedev.stackexchange chat" [game-design]
I have found that most books / technical articles that explain rendering are making an assumption of a level of math knowledge that is ahead of me (extremely good trig at the very least)
My issue I guess is the lack of strength in my Math not the books per say
I would like to see the same topics discussed / covered somewhere but targetted at someone with little more than basic algebra understanding
that would be my new programming bible (should someone write it)
@Wardy not sure what you mean by "rendering" I find the openGL book to be a pretty good reference (as are online tutorials for getting data to it - this was years ago though) coupled with songho.ca/opengl/gl_projectionmatrix.html to be great.
@JoshPetrie please PLEASE do not bring that up here.
user4704
Then keep talking about it where you first started talking about it, please. Don't claim to abandon the discussion and then make snide comments about it elsewhere.
@JoshPetrie Please do not do this in this room, or now.
As a rule of thumb BTW @Wardy (people use density function and your mind just sorta figures out the abstract meaning of density function) basically it describes what the function outputs, per the input.
@TheMuffinCoder please keep it serious in here though. I have no doubt you will, just saying. There is a "start chat with user" button after all :)
@AlecTeal yeh the gpu gems thing just says "a density function" now it took me a few weeks of looking in to the various uses of and understanding them to determine that usually a density function is "a function that returns weight values for the volume being represented within the volume of space given"
without some prior knowledge that's a hard conclusion to come to
Well "density" is usually the clue as it's the best word to describe it. But I do see what you mean. I was reading something today "density of memory regions" and I just sorta knew that they meant "useful allocations / total size"
@AlecTeal Seems reasonable to understand to me ... I've spent quite a long time trying to do 3D math now though so it makes sense ... that said when I started game programming I suspect I might have found that fairly complex too
@Wardy on a serious note, one of the things I come here for is to give users a good bump in the right direction (maybe not tutor them, you know it is my time and all) if you ever get stuck I am happy to type a paragraph setting you on the right course.
You can reach me at [first letter first name] dot [last name] at warwick.ac.uk
I did MEI maths, but my school only went as far as offering AS further, I self taught A2 further, AND AS advanced and A2 advanced (so 3 alevels in maths) then went on to do a maths degree :P
In this case its a planet and I basically just want to gen a normal that points out for each vert as the mesh in this instance is just a perfect sphere portion
void SetNormals(Mesh mesh, Vector3 planetPos, int planetSize)
{
float r = (float)planetSize;
mesh.normals = new Vector3[mesh.vertexCount];
for (int i = 0; i < mesh.vertexCount; i++)
mesh.normals[i] = (planetPos - new Vector3(r, r, r)).normalized;
}
@Wardy I assume you know how graphs work? A vector $\left(\begin{array}{lr}x\\ y\end{array}\right)$ is basically a set of additive co-ordinates (x, y). You use those co-ordinates to define a position or a movement.
void SetNormals(Mesh mesh, Vector3 planetPos, int planetSize)
{
float r = (float)planetSize;
mesh.normals = new Vector3[mesh.vertexCount];
for (int i = 0; i < mesh.vertexCount; i++)
mesh.normals[i] = (planetPos - new Vector3(r, r, r)).normalized;
}
That wont return a normal (you need to divide that by the radius) but it will return something in the same direction as the normal. Given "radius point" is actually a point on the surface.
void SetNormals(Mesh mesh, Vector3 planetPos, int planetSize)
{
float r = (float)planetSize;
mesh.normals = new Vector3[mesh.vertexCount];
for (int i = 0; i < mesh.vertexCount; i++)
mesh.normals[i] = (planetPos - new Vector3(r, r, r)).normalized;
}
So if $\theta=90^\circ$ then $\cos(\theta)=0$ - so if the dot product is 0, the vectors are perpendicular (and if they're in the same direction, this is maximised)
Pythag? You should know how to find the distance between two points
$$\Vert v\Vert = \sqrt{\sum^n_{i=1} v_i^2}$$
So when you hold the torch at a shallow angle to the surface, the light is spread out over a larger area and thus not as strong, as you're stretching some fixed number of photons over a larger area.
However as you approach the normal to the surface intensity increases because those photons are not being spread out (this is also why regions near the equator are warmer - AMONG other things)
So given two unit-length vectors (so their $\Vert\cdot\Vert=1$) the dot product of them is the intensity of the light.
@AlecTeal Sorry, this needs to be addressed. If you're suspended on GD, you shouldn't technically be chatting in GD rooms. Mods don't tend to do anything about it, but if a CM finds you, you'll have a large CM-boot-shaped dent in your backside.
@AlecTeal Dude. Let me point out that you don't know everything and everyone else knows nothing. I noticed something that as a mod I have a duty to query, so I queried it.
Now please try and keep this on topic, if you want to remove those (and this) message I'd be grateful. Provided it shows up as one message removed, not like 8.