一个Java3D 应用程序

import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.GraphicsConfiguration;
import com.sun.j3d.utils.applet.MainFrame; 
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
//   HelloJava3Db renders a single, rotated cube.  
public class HelloJava3Db extends Applet {
    public BranchGroup createSceneGraph() {
	// Create the root of the branch graph
	BranchGroup objRoot = new BranchGroup();

	// rotate object has composited transformation matrix
	Transform3D rotate = new Transform3D();
	Transform3D tempRotate = new Transform3D();
        rotate.rotX(Math.PI/4.0d);
	tempRotate.rotY(Math.PI/5.0d);
        rotate.mul(tempRotate);
	TransformGroup objRotate = new TransformGroup(rotate);

	objRoot.addChild(objRotate);
	objRotate.addChild(new ColorCube(0.4));
	// Let Java 3D perform optimizations on this scene graph.
        objRoot.compile();
	return objRoot;
    } // end of CreateSceneGraph method of HelloJava3Db
    // Create a simple scene and attach it to the virtual universe
    public HelloJava3Db() {
        setLayout(new BorderLayout());
        GraphicsConfiguration config =
           SimpleUniverse.getPreferredConfiguration();
        Canvas3D canvas3D = new Canvas3D(config);
        add("Center", canvas3D);

        BranchGroup scene = createSceneGraph();

        // SimpleUniverse is a Convenience Utility class
        SimpleUniverse simpleU = new SimpleUniverse(canvas3D);

	// This will move the ViewPlatform back a bit so the
	// objects in the scene can be viewed.
        simpleU.getViewingPlatform().setNominalViewingTransform();

        simpleU.addBranchGraph(scene);
    } // end of HelloJava3Db (constructor)
    //  The following allows this to be run as an application
    //  as well as an applet

    public static void main(String[] args) {
	Frame frame = new MainFrame(new HelloJava3Db(), 256, 256);
    } // end of main (method of HelloJava3Db)

} // end of class HelloJava3Db

 

java3D显示一个球的代码 java3D入门的示例,显示一个球体,适合初学Java3D的人。 立即下载

相关推荐

java3D程序源代码

里面包含了 好几个java3D的源代码,很好,很强大,对想学习java3D的人,帮助很大。

JAVA3D环境变量配置

1.环境需要 (1)JDK(我使用的是1.8版本的)不要用太高的版本下载地址链接:https://pan.baidu.com/s/1FDvJcG5SMdWxl3fVnRbmRw 提取码:6cdp (2)需要JAVA3D插件的安装下载路径为:https://download.youkuaiyun.com/download/hongfei568718926/11670370 安装的时候选对你的JDK的版...

hongfei568718926的博客 1863

java3d applet 入门小案例

java3d applet 入门小案例 import java.applet.Applet; import java.awt.*; import com.sun.j3d.utils.applet.MainFrame; import java.awt.BorderLayout; import com.sun.j3d.utils.universe.SimpleUniverse; import javax.media.j3d.*; import javax.vecmath.*; import com.sun.j3d.utils.behaviors.mouse.*; import com.sun.j3d.utils.geometry.*; import com.sun.j3d.utils.image.TextureLoader;

计算机图形学环境配置java3D

计算机图形学环境配置java3D

白泓的博客 1149

java3d小程序(建立一个立方体)

教程中的一个小例子,使用java3d的api编写的一个小程序,建立一个立方体。

基于java3D 实现编辑动画

基于java3D 实现编辑动画,用于初级到高级的程序员学习

java毕业设计——基于java+Java3D的网络三维技术设计与实现(毕业论文+程序源码)——三维技术

互联网的出现及飞速发展使IT业的各个领域发生了深刻的变化,它必然引发一些新技术的出现。3D图形技术并不是一个新话题,在图形工作站以至于PC机上早已日臻成熟,并已应用到各个领域。然而互联网的出现,却使3D图形技术发生了和正在发生着微妙而深刻的变化。Web3D协会(前身是VRML协会)最先使用Web3D术语,这一术语的出现反映了这种变化的全貌,没有人能严格定义Web3D,在这里我们把Web3D理解为:互联网上的3D图形技术,互联网代表了未来的新技术,很明显,3D图形和动画将在互联网上占有重要的地位。

m0_66238867的博客 3972

银河麒麟V10+QT6.0中文输入法环境搭建全攻略(附镜像加速技巧)

本文提供了在银河麒麟V10操作系统上为QT6.0搭建中文输入法环境的完整实战指南。文章详细介绍了从系统准备、镜像源优化、QT6安装器获取与加速安装,到编译Fcitx5输入法插件依赖库、深度配置环境变量与项目的全流程。重点分享了使用国内镜像源加速安装的技巧,解决了国产化开发中QT应用无法输入中文的常见难题,旨在帮助开发者快速构建稳定高效的开发环境。

weixin_29204749的博客 393

Java 入门编写3D福彩系统

Java入门编写3D福彩系统

m0_62052192的博客 1255

2026开源API网关横评:微服务与AI流量治理如何选型

API网关作为微服务架构的流量入口,承担着路由转发、安全管控、限流熔断等核心职责,是分布式系统治理的基础设施。随着大模型应用的普及,AI流量对网关提出了新的要求,如流式响应支持、Token级限流、多模型路由和成本分账等能力。传统网关通过插件拼凑AI功能,而AI原生网关则将这些能力内建。面对众多开源方案,如何根据业务场景做出合理选型?本文对Kong、APISIX、Higress、Envoy Gateway、MAI Gateway等主流开源API网关进行横向评测,从性能、动态性、K8s集成度、AI流量治理等维度

weixin_34242819的博客 482

用树莓派搭建全功能NAS服务器(01):树莓派基础操作&OMV搭建

写在前面 对于文件互传来说,局域网和云盘的操作总是独立的,而且很难将两者的优势合为一体。如果想要集多种优势为一体,那么NAS应该就是较为完美的解决方案了。 在这个系列中我们尽量跳过一些枯燥的理论知识,专注于说明两件事:   1.NAS是什么&能做什么 2.搭建思路&怎么做   这中间也会涉及到一些方案的选择,同类方案我也会列出来和大家分享我已知的优缺点,有兴趣可以多种尝试。(侧重于软件) 虽然是用树莓派搭建的,但是对于debian linux系统下的NAS搭建有着很好的参

斯塔克家的真维斯的工作间 2万+

java3d综合实例

package test; import com.sun.j3d.utils.applet.MainFrame; import com.sun.j3d.utils.behaviors.mouse.MouseRotate; import com.sun.j3d.utils.behaviors.mouse.MouseTranslate; import com.sun.j3d.utils.behavi

zgrjkflmkyc的专栏 4173

Delphi解决 openssl DLL 与 Indy 的SSL/TLS 连接问题

​ 使用 SSL 连接时出错。错误 1409442E:SSL 例程:ssl3_read_bytes:tlsv1 警报协议版本 由于我使用的是最新版本的Indy,根据Delphi Praxis 上的此线程,这种情况不应该发生。事实证明,不知何故,一个非常旧版本的 openssl DLLlibeay32.dll和ssleay32.dll已被放置在我计算机上的 sarch 路径中(版本 1.0.0e)。

Delphi开发局QQ群:32422310 2495

java3D一个场景内创建两个以上的图形

<br />package test;<br />import java.applet.Applet;<br />import java.awt.BorderLayout;<br />import java.awt.Color;<br />import javax.media.j3d.Appearance;<br />import javax.media.j3d.Background;<br />import javax.media.j3d.BoundingSphere;<br />import javax

游侠的专栏 1633

STM32F103RC学习(一)

STM32F103RC学习(一)

Cat_South_North的博客 6057

【毕设】基于LoRa的物联网控制器:从原理图到PCB的完整硬件设计指南

本文提供了一份完整的基于LoRa的物联网控制器硬件设计指南,涵盖从系统框图、原理图设计到PCB布局布线的全流程。详细讲解了电源电路、单片机最小系统、信号接口以及LoRa无线模块等核心模块的设计要点与抗干扰技巧,并分享了实用的调试心得,旨在帮助电子、物联网专业学生顺利完成毕业设计,掌握低功耗远距离物联网节点的硬件开发实践。

weixin_42126677的博客 306

Java3D读取3DMax模型并实现鼠标拖拽、旋转、滚轮缩放等功能

  /**-------------------------------------------------代码区--------------------------------------------------------**/ import java.applet.Applet; import java.awt.BorderLayout; import java.awt.Graphics...

qq_33430119的博客 1461

跨应用服务器的自定义 IDoc 传输实战:以 CATSDB 工时为例,打通两套 SAP 系统的数据通道

本文介绍了在企业多SAP系统环境下,使用SAP ALE/IDoc技术实现工时数据跨系统传输的解决方案。文章从技术选型、系统架构到具体配置步骤进行了详细说明,重点阐述了IDoc/ALE在异步传输、全链路追踪和数据重放方面的优势。 文章详细讲解了端到端实施流程,包括Logical System配置、RFC Destination创建、Message Type定义、Segment和Basic Type设计等关键步骤。同时提供了出站封装的ABAP代码示例,强调调用MASTER_IDOC_DISTRIBUTE函数后执

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 173

java3D添加纹理

package Ct; import com.sun.j3d.utils.applet.MainFrame; import com.sun.j3d.utils.behaviors.mouse.MouseRotate; import com.sun.j3d.utils.behaviors.mouse.MouseTranslate; import com.sun.j3d.utils.behavior...

姜甜甜的专栏 881

Python从0到100(十九):Python标准库初探

哈希函数又称哈希算法或散列函数,是一种为已有的数据创建“数字指纹”(哈希摘要)的方法。哈希函数把数据压缩成摘要,对于相同的输入,哈希函数可以生成相同的摘要(数字指纹),需要注意的是这个过程并不可逆(不能通过摘要计算出输入的内容)。举一个简单的例子,用户注册时我们希望在数据库中保存用户的密码,很显然我们不能将用户密码直接保存在数据库中,这样可能会导致用户隐私的泄露,所以在数据库中保存用户密码时,通常都会将密码的“指纹”保存起来,用户登录时通过哈希函数计算密码的“指纹”再进行匹配来判断用户登录是否成功。

拥有百余位万粉技术博主、200余位可合作代发博主,私域技术社群规模达千人,商务合作私信 5004

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

java3d效果_[转载]JAVA3D 灯光效果实例

package unit5;import java.applet.Applet;import java.awt.BorderLayout;import java.awt.GraphicsConfiguration;import com.sun.j3d.utils.applet.MainFrame;import com.sun.j3d.utils.geometry.Sphere;import com...

weixin_30160343的博客 344

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

sweet home3d_Sweet Home 3D的开源室内设计

sweet home3d 关于如何装饰房间,有三种思路: 买一堆家具,塞进房间 仔细测量每件家具,计算房间的理论容量,然后将它们全部塞进去,而忽略了您在床上放置书架的事实 使用计算机进行预可视化 更多精彩内容 免费在线课程:RHEL技术概述 学习高级Linux命令 下载备忘单 查找开源替代方案 阅读热门Linux内容 查看开源资源 从历史上...

cumj63710的博客 2395

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

java3D的例子 能解释吗

public class ControlPanel extends JPanel{    private AnimationBehavior anim;    private AnimPanel animPanel;    private Display display;    private Walkmesh walkmesh;    private JTabbedPane tabs

huangchuangege的专栏 1134

Java3D-任意角度查看对象

[b]关键词:Java3D对象,任意角度,查看[/b] 一个Java3D的鼠标拖动组件的特效,通过鼠标可以随意角度的查看3D对象。 运行效果如下图: [img]http://www.kutoku.info/images/java/100910/3d01.png[/img] [img]http://www.kutoku.info/images/java/100910/3d02.png[/im...

来杯咖啡,随便聊聊。 197

java怎么嵌入c,将Java嵌入到C ++应用程序中?

I got an application written in C++ and I am able to extend the applications functionality by writing plugins in C++ for it.What I basically want to do is to embed Java into this application. This has...

weixin_39676930的博客 277
上一篇: Java 制作的一个放大镜程序
下一篇: Java UI 之 JSplitPane
CONLONG
博客等级 码龄20年 35粉丝 64原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值