java 3d模型,Java的3D - 建立3D模型动态

本文档介绍了使用Java构建3D模型,特别是如何动态创建并定位两个相连的圆柱体。作者遇到的问题是第二个圆柱体没有正确放置在第一个圆柱体的顶部。解决方案涉及调整圆柱体的位置,确保它们正确对接,并提出了创建连接任意两点之间圆柱体的辅助函数建议。
摘要由CSDN通过智能技术生成

im trying to build a 3D Model, by building dynamically 3D models and translate them to where i need them.

Im starting with a basic model, trying to to achieve what is on the picture bellow. I want to dynamically build two cylinders, and the X,Y,Z of the TOP of my cylinder will be the same X,Y,Z of the BOTTOM of the second Cylinder, like the picture bellow:

tWxNz.png

For now i have this code:

public static void main(String[] args) throws FileNotFoundException, IOException {

int height = 10;

int radius = 1;

int angle = 0;

BranchGroup objRoot = new BranchGroup();

Cylinder cylinder;

Vector3f last_coordinates = new Vector3f(0f,0f,0f);

TransformGroup transf_group_cylinder = null;

//---- Working ok -----/</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值