3d对象的阴影在javafx [英] shadow of 3d objects in javafx

查看:184
本文介绍了3d对象的阴影在javafx的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在javafx中创建3d对象的阴影?
我试图创建

How to create shadow of 3d object in javafx? I tried to create with

Parent root2 = FXMLLoader.load(getClass().getResource("ball.fxml"));

Shadow shadow = new Shadow();

root2.setEffect(shadow);

结果如下:

没有阴影

带阴影

有人可以帮助我创建三维物体的阴影?
谢谢!

Can someone help me to create shadows of 3d objects? Thanks!

推荐答案

影子效果用于实现投影样式效果;它不会为3D对象创建适当的阴影效果,也不会为此目的而构建。

The Shadow effect in JavaFX is for implementing drop shadow style effects for 2D objects; it will not create appropriate shadow effects for 3D objects and is not built for that purpose.

核心JavaFX 8 3D API没有内置方法来支持为3D对象生成阴影效果。

The core JavaFX 8 3D API has no in-built methods for supporting generation of shadow effects for 3D objects.

您可以阅读实现3D对象阴影的各种技术并尝试实施适当的算法基于Java 8 3D API提供的图形基元。这样做可能是IMO非常困难的任务。

You could read up on various techniques for implementing shadows for 3D objects and attempt implementing an appropriate algorithm based on the graphics primitives that are supplied with the Java 8 3D API. Doing so would likely be a pretty difficult task IMO.

如果3D对象的阴影对您很重要,您可能希望考虑替代 3D API这提供了更大程度的3D影子支持

If shadows for 3D objects are important for you, you may wish to consider an alternative 3D API that provides a greater degree of 3D shadow support.

这篇关于3d对象的阴影在javafx的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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