Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » 3d Shape Class(How to write a class for a 3d cube.)
3d Shape Class [message #1768257] Sun, 16 July 2017 04:38 Go to next message
Paul Rethier is currently offline Paul RethierFriend
Messages: 1
Registered: July 2017
Junior Member
Hi my name is Paul and not only am I new to Java, I am also new to programming all out. So I am sorry if I'm asking a very elementary question.
I am trying to figure out how to write a class for a 3d cube. I can not figure out how and where you're suppose to write the code for the vertices and nodes. This is what I have written and it's completely wrong so far.

package shapes;
public class CubeMain extends Object {
//Fields
private int nodes;
private int edges;
//Constructors
public CubeMain() {
int nodes = x,y,z,w,h,d;
nodes = x,y,z,
x,y,z+d,
x,y+h,z,
x, y+h, z+d,
x+w, y, z,
x+w, y, z+d,
x+w, y+h, z,
x+w, y+h, z+d;
}
//Methods
}
Re: 3d Shape Class [message #1768262 is a reply to message #1768257] Sun, 16 July 2017 07:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is not an appropriate forum for this type of question. This is a basic question about how to program in Java but this forum is for asking questions about how to use Eclipse. Even when I think of other forums such as StackOverflow and JavaRanch I imagine people answering questions there will expect you to learn at least some basics of Java so you can ask a question that isn't of the form, Can you teach me Java.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: 3d Shape Class [message #1768280 is a reply to message #1768262] Sun, 16 July 2017 19:20 Go to previous message
Jeff Evarts is currently offline Jeff EvartsFriend
Messages: 5
Registered: July 2017
Junior Member
Paul,

As you are new to programming, it's very easy to understand your mistake, so let me try and explain what's going on.

By analogy, you've stumbled into a power tools seminar and you're asking a table saw vendor "How do I build a 2-story colonial home with aluminum siding?". The table saw vendor doesn't know, and is confused why you're asking him.

Eclipse is a tool, like a hammer or saw, that can be used to do many things, including write programs, including writing programs in java, and including writing programs in java that do graphics.

Your question is about using java, probably with OpenGL or LWJGL, to write a program to draw a cube.

Since your question has to do with java programming, it's not an eclipse question. Beyond that it's a library-specific question (how do I put a cube on the screen) so it's not really a java question either. You need to find a forum (such as at opengl.org or lwjgl.org) which will have people more likely to have experience aligned with your question.

Allow me to further recommend searching "opengl java tutorial" in Google and Youtube for more information.

Good luck, sir!
-Jeff
Previous Topic:Combined Java and C++ code compilation
Next Topic:A detailed record of Java history - like Kernighan- & Richie- 's book
Goto Forum:
  


Current Time: Fri Apr 26 00:58:35 GMT 2024

Powered by FUDForum. Page generated in 0.08095 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top