Jump to content
  • Advertisement
Sign in to follow this  
lol

[java] 3d keyword

This topic is 3592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was just browsing somebody else's source code so I could figure out how to implement csg when I saw this
[source lang = 'java']

		//creating a ray starting starting at the face baricenter going to the normal direction

		Point3d p0= new Point3d();

		p0.x = (v1.x + v2.x + v3.x)/3d;

		p0.y = (v1.y + v2.y + v3.y)/3d;

		p0.z = (v1.z + v2.z + v3.z)/3d;

		Line ray = new Line(getNormal(),p0);


does anybody know what the 3d keyword means?

Share this post


Link to post
Share on other sites
Advertisement
the 3d keyword mean that the point is in a 3 dimensional plane, not only does it have an x and y axis but a z axis as well.

Share this post


Link to post
Share on other sites
D or d indicates that the number is a double precision floating point number.
He could have used 3.0 instead, but 3d was funnier i suppose.

Share this post


Link to post
Share on other sites
it's not a keyword ... it means they're dividing by 3 as an double rather than a float or integer. I forget the exact name of the letter, but put "f" after values you want treated as floats

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!