C ++中的vector3D [英] vector3D in C++

查看:1589
本文介绍了C ++中的vector3D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vector3D中定义一个由三个点组成的位置?以及如何开发具有这些点的多维数据集?

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

推荐答案

您不能创建基于单个矢量的多维数据集.至于其余的,您已经知道了什么?我的意思是,您问的是最基本的3D问题,还是您已经了解了其中的一些内容.请编辑您的问题以提供更多详细信息.我怀疑答案是您最好买一本书来学习3D系统的工作原理.
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.


您是在问如何创建自己的Vector3D或如何使用现有的Vector3D. Vector3D类?您具体遇到什么麻烦(C ++语法,概念化3D点,确定要使用的数据类型,编译错误等)?
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.)?


创建具有3个浮点的类.添加一个接受3个浮点数的构造函数以设置这些变量.要创建一个多维数据集,请为多维数据集上的每个点创建一个Vector3D(提示:一个多维数据集至少需要8个点).您需要知道如何使用3D点(提示:x,y,z).您似乎是一个初学者,因此以下是您在Google如何执行所有操作时要使用的一些关键字:
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


这篇关于C ++中的vector3D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆