Noob learns to code in 3 months

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Noob learns to code in 3 months

Post by chili » October 1st, 2017, 3:30 pm

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.
Chili

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » October 1st, 2017, 4:03 pm

^ 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

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » October 2nd, 2017, 11:54 am

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);
}

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » October 2nd, 2017, 4:23 pm

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);

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » October 6th, 2017, 11:21 am

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

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Noob learns to code in 3 months

Post by chili » October 6th, 2017, 1:17 pm

effective modern c++ looks good to me, i might wanna peek it sometime myself.
Chili

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » October 6th, 2017, 1:36 pm

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.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Noob learns to code in 3 months

Post by chili » October 6th, 2017, 3:41 pm

Moving away from OOP.

Image
Chili

User avatar
Yumtard
Posts: 575
Joined: January 19th, 2017, 10:28 pm
Location: Idiot from northern Europe

Re: Noob learns to code in 3 months

Post by Yumtard » October 6th, 2017, 5:07 pm

^ :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

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Noob learns to code in 3 months

Post by chili » October 6th, 2017, 5:20 pm

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.
Chili

Post Reply