Page 61 of 68

Re: Noob learns to code in 3 months

Posted: October 1st, 2017, 3:30 pm
by chili
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.

Re: Noob learns to code in 3 months

Posted: October 1st, 2017, 4:03 pm
by Yumtard
^ 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 :D

Do pokemon imo :D Was an interesting one and everyone likes the old pokemon games

Re: Noob learns to code in 3 months

Posted: October 2nd, 2017, 11:54 am
by Yumtard
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

Posted: October 2nd, 2017, 4:23 pm
by Yumtard
I feel stupid now when I read this

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;
Because I've already made a function for dot product so tomorrow in school I'll change it to

Code: Select all

d1 = Normal.DotProduct(PointInPlane);

Re: Noob learns to code in 3 months

Posted: October 6th, 2017, 11:21 am
by Yumtard
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

Re: Noob learns to code in 3 months

Posted: October 6th, 2017, 1:17 pm
by chili
effective modern c++ looks good to me, i might wanna peek it sometime myself.

Re: Noob learns to code in 3 months

Posted: October 6th, 2017, 1:36 pm
by Yumtard
chili wrote:effective modern c++ looks good to me, i might wanna peek it sometime myself.
Yeah that'll be the next thing I read after game programming patterns.

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

Posted: October 6th, 2017, 3:41 pm
by chili
Moving away from OOP.

Image

Re: Noob learns to code in 3 months

Posted: October 6th, 2017, 5:07 pm
by Yumtard
^ :D

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

Posted: October 6th, 2017, 5:20 pm
by chili
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.