Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

How can I define a position in vector3D which consists of three points? And how can I develop a cube with that points?

Posted
Updated 1-Dec-09 5:03am
v4

you can't create a cube baed on a single vector. As for the rest, what do you know already ? I mean, are you asking the most basic 3D question, or do you already understand some of it. Please edit your question to provide some more detail. I suspect the answer will be that you'd best buy a book to learn how the 3D system works.
 
Share this answer
 
Are you asking how to create your own Vector3D, or how to use an existing Vector3D class? What specifically are you having trouble with (C++ syntax, conceptualizing a 3D point, deciding what data types to use, compilation errors, etc.)?
 
Share this answer
 
Create a class with 3 floats. Add a constructor that accepts 3 floats to set those variables. To create a cube, create a Vector3D for each point on the cube (hint: a cube needs a minimum of 8 points). You need to know how to use 3D points (hint: x, y, z). You seem to be a beginner, so here are some keywords to use when you google how to do all this:
c++ class
c++ constructor
c++ class variable
c++ class instance
c++ beginner tutorial
c++ console application
c++ float
c++ double
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900