Noob learns to code in 3 months
Re: Noob learns to code in 3 months
Good stuff man. Geometry problems like this are good shit to learn to get more fluid in this math stuff.
in the above, you could have just factored out z to get z((-B1/B2)*C1+C2) and then divided both sides by ((-B1/B2)*C1+C2).
I'm thinking about (not sure yet but maybe) doing something similar to your pokemon / McCree assignment to introduce inheritance for the first time (and later dynamic dispatch). Might be simpler than trying to demo it in some existing graphical game code from earlier tutorials.
in the above, you could have just factored out z to get z((-B1/B2)*C1+C2) and then divided both sides by ((-B1/B2)*C1+C2).
I'm thinking about (not sure yet but maybe) doing something similar to your pokemon / McCree assignment to introduce inheritance for the first time (and later dynamic dispatch). Might be simpler than trying to demo it in some existing graphical game code from earlier tutorials.
Chili
Re: Noob learns to code in 3 months
^ yeah but I was confused about the results since they didn't match the results of the equation I was looking up online, but it turned out his result was incorrect
Do pokemon imo Was an interesting one and everyone likes the old pokemon games
Do pokemon imo Was an interesting one and everyone likes the old pokemon games
Re: Noob learns to code in 3 months
yay seems to work!
Code: Select all
CLine CPlane::IntersectionLine(const CPlane & rhs)
{
CVector3D dir = Normal.CrossProduct(rhs.Normal);
const float d1 = Normal.x * PointInPlane.x + Normal.y * PointInPlane.y + Normal.z * PointInPlane.z;
const float d2 = rhs.Normal.x * rhs.PointInPlane.x + rhs.Normal.y * rhs.PointInPlane.y + rhs.Normal.z * rhs.PointInPlane.z;
float x, y, z;
if (dir.x != 0.0f)
{
x = 0.0f;
z = ((rhs.Normal.y / Normal.y) * d1 - d2) / ((-rhs.Normal.y / Normal.y) * Normal.z + rhs.Normal.z);
y = ((-Normal.z * z) - d1) / Normal.y;
}
else if (dir.y != 0.0f)
{
y = 0.0f;
z = ((rhs.Normal.x / Normal.x) * d1 - d2) / ((-rhs.Normal.x / Normal.x) * Normal.z + rhs.Normal.z);
x = ((-Normal.z * z) - d1) / Normal.x;
}
else
{
z = 0.0f;
y = ((rhs.Normal.x / Normal.x) * d1 - d2) / ((-rhs.Normal.x / Normal.x) * Normal.y + rhs.Normal.y);
x = ((-Normal.y * y) - d1) / Normal.x;
}
CVector3D pos1(x, y, z);
CVector3D pos2 = pos1 + dir;
return CLine(pos1, pos2);
}
Re: Noob learns to code in 3 months
I feel stupid now when I read this
Because I've already made a function for dot product so tomorrow in school I'll change it to
Code: Select all
const float d1 = Normal.x * PointInPlane.x + Normal.y * PointInPlane.y + Normal.z * PointInPlane.z;
const float d2 = rhs.Normal.x * rhs.PointInPlane.x + rhs.Normal.y * rhs.PointInPlane.y + rhs.Normal.z * rhs.PointInPlane.z;
Code: Select all
d1 = Normal.DotProduct(PointInPlane);
Re: Noob learns to code in 3 months
Made a list of books to read on my spare time.
- Game programming patterns (reading this atm)
- Effective modern c++
- Game programming gems (a bunch of these)
- Programmaing AI by example
- Artificial intelligence for games
- Real time collision detection
- Game engine architecture
- Data structures and algorithms
If there's any muse read books I should include here or any on the list I could skip, let me know
- Game programming patterns (reading this atm)
- Effective modern c++
- Game programming gems (a bunch of these)
- Programmaing AI by example
- Artificial intelligence for games
- Real time collision detection
- Game engine architecture
- Data structures and algorithms
If there's any muse read books I should include here or any on the list I could skip, let me know
Re: Noob learns to code in 3 months
effective modern c++ looks good to me, i might wanna peek it sometime myself.
Chili
Re: Noob learns to code in 3 months
Yeah that'll be the next thing I read after game programming patterns.chili wrote:effective modern c++ looks good to me, i might wanna peek it sometime myself.
My teacher also gave me some links with stuff to read/video to watch about DOD since we'll be moving away from OOP eventually.
Re: Noob learns to code in 3 months
^
Next course starts on monday and we'll still be doing OOP for that one. After that we have game projects so I'm guessing we wont start data oriented design until after christmas.
Will be interesting to learn something new imo.
Read some about DOD but don't quite get it yet. I'm assuming it's used a fair amount in the game industry if we're going to learn it
Next course starts on monday and we'll still be doing OOP for that one. After that we have game projects so I'm guessing we wont start data oriented design until after christmas.
Will be interesting to learn something new imo.
Read some about DOD but don't quite get it yet. I'm assuming it's used a fair amount in the game industry if we're going to learn it
Re: Noob learns to code in 3 months
DOD is interesting, and can be useful, though I'm not sold on full-JBlow style DOD.
At any rate I think it will be a good thing to study and get ideas from.
At any rate I think it will be a good thing to study and get ideas from.
Chili