javafx,3d,transparency,transparent,javafx-3d , JavaFX 3D TriangleMesh with transparency


JavaFX 3D TriangleMesh with transparency

Question:

Tag: javafx,3d,transparency,transparent,javafx-3d

I have a texture I want to use for a TriangleMesh (it's a simple cube). Some parts of the texture are transparent. When I put the texture on the mesh, it's black. Is there a possibility to change that? I would like to make it transparent.

Appreciate your help, thanks


Answer:

Transparency in JavaFX 3D shapes has been a long time request... until recently: Since JDK8u60 early access release b14, transparency is enabled in 3D shapes.

You can add color with transparency as diffuse color, like in this answer.

Also you can add images with some transparency level on every pixel, like this one:

Cylinder

where this is the image used with 50% transparency:

palette

And you can use full transparency areas too. For instance, in this image, Duke has 50% transparency and the rest is 100% transparent:

Duke

Giving this result applying that image as diffuse map over the cylinder:

Cylinder 2

Have a look at FXyz project for more details on creating 3D shapes and using textures in many different ways, and the FXyz Sampler.


Related:


How would I connect to a MySQL database back-end from an Android device's application? [closed]


java,android,mysql,javafx,apk
I have developed a standalone JavaFx application in Netbeans with a MySQL database back-end which I want to also package as an APK package for running on Android. How would I go about porting the MySQL database script it uses to Android?

How to display HTML in JavaFX Application


java,javafx,javafx-8
I am developing a FontViewer application which changes the font of the text based on the selected font style. This is the controller class of my application public class FXMLDocumentController implements Initializable { @FXML private ListView fontListView; @FXML private TextArea fontTextArea; int[] fontSizes = {34, 28, 24, 20, 18, 16,...

Filter JDK Bug System by JavaFX


java,javafx,openjdk
Is there a way (filter settings, etc) to see only JavaFX related bugs in the JDK Bug System? Also, the Reporter names seem to be gone. Now I'm "J. Duke", I guess like everyone else that doesn't have an acount there. So how do I find the bugs I reported?...

How to change the color of treeitem expand and collapse arrow in javafx?


javafx,treeview
I have got some trouble with treeitems of a treeview. There are expand and collapse icon-arrows, when you have child-treeitems. I only know how to change the background-color of this expand/collapse icons. But I don't know how to change the color of the arrow. .tree-cell .tree-disclosure-node { -fx-background-color: #CCCCCC; }...

JavaFX: How can I horizontally center an ImageView inside a ScrollPane?


javafx,imageview,scrollpane
viewScroll.setContent(new ImageView(bigimg)); double w = viewScroll.getContent().getBoundsInLocal().getWidth(); double vw = viewScroll.getViewportBounds().getWidth(); viewScroll.getContent().setTranslateX((vw/2)-(w/2)); viewScroll.toFront(); I set an ImageView with some Image inside the ScrollPane but the ImageView always goes to the far left corner. Here I'm trying to manually offset the difference, but it doesn't work well. The ImageView goes too far...

3D Lines disappear sometimes


javascript,d3.js,3d,three.js
I am building 3d line chart from data here is the code Demo the part of code that generate line is parentTransform = new THREE.Object3D(); var _color = d3.scale.category10(); for (var i = 5; i > 0; i--) { var material = new THREE.LineBasicMaterial({ // color: 0x0000ff,linewidth: 30 color: _color(i),...

Chart JavaFX, my hover Label are hidden by the edges of chart


charts,javafx,popup,linechart
I have a problem again with the JavaFX Chart : D Context : I had Popup/Label on my chart to display the value on hover : JavaFX LineChart Hover Values (Jewelsea answer) Problem : But when the point are near the edges of chart, the popup is hidden by them....

LayoutY of GridPane not affected by ScrollBar Listener


java,javafx
I have a GridPane that i fill dynamically, then I display it, the problem is: if the rows are so many, then the rows in the bottom don't get displayed, what i want is to add a scrollbar so that I can display all of the rows, here is the...

javafx position elements around a central point


java,javafx,javafx-8
Apologies, as this is a rubbishy asked question, but I am totally flumped here about the best approach. I believe there must be something inbuilt or common practice for this but I can't find it and Google has turned up nothing of much value. I have a javafx scene with...

Javafx Tableview dont show data of ObservableList


user-interface,javafx
i have a Problem mit the Tableview in JavaFX. I know there are some other posts in the forum, but i checked them and tried to use the solutions, but nothing work for me ... I have 3 Classes. One Version class, the data model. The Class which populats the...

Where do I file bugs for JavaFX?


javafx,javafx-8,scenebuilder
Now that JavaFX Jira Issue Tracker has been moved to JDK Bug System, I don't find an option to file a new bug to the developers. Rather, I find an information saying: Everyone with OpenJDK Author status or above has a JBS account which may be used to create and...

Exception when using CheckListView of Controls FX


javafx,controlfx
I have the error : Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException: Index: 0 I thought it was because I have to use Platform.runLater(), but it seems the errors does not come from this. Here's the function that I try to correct with Platform.runLater() : public void setListAirportForFilter(ListAirport listAirport){ this.myListAirport...

How to create toolbar with left, center and right sections in javaFX?


java,javafx,alignment,toolbar
I'm trying to create a customized toolbar in javafx. This toolbar should be able to display controls in the center, in the left side and in the right side (three sections) of its surface. The problem is that I have no idea to achive this. I read many hints related...

How to calculate a random point inside a cube


math,vector,3d,cube
I'm trying to figure out the math to find a random point inside a cube. I have something small but it can't take into account the rotation of the cube. Here are some images of my results. Here you can see the cube is rotated to some degree but when...

Rotate line segment with Button


math,javafx,geometry,coordinates
I have a line which has points (x1,y1) and (x2,y2). I wanted to attach a Button to it, it should align with the line by rotating based on the line segment points. I need some help in calculating the rotation angle for the Button.

FX - Suggestions for aligning CheckBox in Grid


java,checkbox,javafx,grid,alignment
Converting from Swing to FX here. We have some CheckBoxes where the Label appears on the left side of the CheckBox. We are accomplishing this by calling setNodeOrientation(NodeOrientation.RIGHT_TO_LEFT); The problem is that in some GridPanes, we'll have a Label in column 0 with a Node in column 1 on row...

Difference between Pane and Group


javafx,group,pane
My question is simple : in JavaFX, what is the difference between a Pane and a Group ? I can't make any difference ... Thank for your answer...

JavaFX subclassed Button - How to make Label update work?


java,javafx
I want to have several JavaFX Buttons that update one Label in my Application with text. For testing purposes it's just Button Text. What I did at first worked fine and looked like this: String Text = "..."; public void kons() { System.out.println("Works..."); System.out.println(Text); Tekst.setText(Text); Button G4 = new Button("Spadantes");...

What is wrong with this JavaFX/FXML custom component?


java,javafx,javafx-8,fxml,fxmlloader
I am learning to write FXML custom components for use with JavaFX 8 and Scene Builder. I wrote the FXML file shown below but Scene Builder will not open it, giving me the message "Open operation has failed" due to the exception: java.io.IOException: javafx.fxml.LoadException: mycustomcomponent.TicoTeco is not a valid type....

How is the Point2D “angle” method to be understood?


javafx,geometry
I thought I'd use the Point2D class for calculating e. g. the angle betwen 2 points instead of creating a utility method. It turned out, it's not usable at all. Code example: Point2D p1; Point2D p2; p1 = new Point2D(0, 0); p2 = new Point2D(10, 10); System.out.println( "Point2D: " +...

Pygame 3D: How to and is it possible?


python,performance,dictionary,3d,pygame
So I want to program a 3d-mesh viewer in pygame, no other 3rd-party modules wanted (panda3d is perfect, but it's very complicated). My idea is: list_of_surfs = {'85 50':'70deg'} #the 85 50 and the dimensions of the #side/surf, and 70 deg of rotation to be able to see it, then...

Getting a mouse position with JavaFX and Event


java,javafx
I'm trying to get the position of a mouse click in my JavaFX application. I have an EventHandler as so: EventHandler<Event> mouseHandler = new EventHandler<Event>() { @Override public void handle(Event event) { String eType = event.getEventType().toString(); if(eType.equals("MOUSE_PRESSED")){ //mouse position } } }; which is called on mouse press, release and...

JavaFX FilteredList, filtering based on property of items in the list


javafx,javafx-8
I have a case where I need to filter a ObservableList<Item> based on some properties of the items (i.e. the condition is internal and not external). I found out that javafx has FilteredList so I tried it. I could set the predicate and filtering works, until the property value that...

Why JavaFX requires Platform.runLater to change anything in it's UI inside a thread?


java,multithreading,swing,javafx
This code of a simple swing application: final JFrame jFrame = new JFrame(); final JLabel jLabel = new JLabel("Test"); jFrame.add(jLabel); jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jFrame.pack(); jFrame.setLocationRelativeTo(null); jFrame.setVisible(true); Thread thread = new Thread(){ @Override public void run() { while(true) { jLabel.setText("Time: " + System.currentTimeMillis()); try { Thread.sleep(1000);} catch(Exception ex) {} } } }; thread.setDaemon(true);...

Add Layouts on TabPane JavaFX


java,user-interface,javafx,tabpanel
i have a quick question. I want to build an UI with JavaFX. It should have tabs, each with some content. The problem that I have is, I dont know how to arrange the content in the tabs properly. Is there a possibility to add a Layout to the tabs?...

JavaFX splash screen message and progress not updating


java,multithreading,javafx
I have a JavaFX application that checks for the presence of a database at startup. If the database is not found, a "seed" database must be created before the program can proceed. Since creating the seed database can be lengthy, I want to display a splash screen and show progress...

Multi-Threading error when binding a StringProperty


java,multithreading,javafx,javafx-8
I have a question about multi-threading and the binding of a StringProperty. I have a class CacheManager, which contains a Thread which updates my cache with the changes on the server. Now, I want to notify the user with a text and percentage of the progress (which are a Label...

How to change ImageView on KeyPressed


javafx
I am having difficulty trying to solve this, I am currently trying to figure out how to change the ImageView to another ImageView when I press a certain Key on my keyboard but I have no idea how to, I have already looked around almost everywhere I can think of...

Displaying surface with non-rectangular boundary


matlab,image-processing,plot,3d,surface
Refer to the attached image. I want to display the image in Matlab using the function surf(). However, I only want to display the region of the actual object without the background (the pale-green region surrounding the actual object which has 0 value). How to do that? I tried replacing...

JavaFX Input Validation Textfield


java,javafx
I'm using JavaFX and Scene Builder and I have a form with textfields. Three of these textfields are parsed from strings to doubles. I want them to be school marks so they should only be allowed to be between 1.0 and 6.0. The user should not be allowed to write...

MATLAB: How to make camera light follow 3D Rotation


matlab,user-interface,3d,rotation,lighting
I have come into a problem recently when trying to rotate 3D objects. I am building a GUI and I have a separate figure where an object is plotted. In the figure, I allow the user to use MATLAB's built-in rotate button to move the object around. However, I am...

JavaFx TreeCell how to expand nodes after one second


javafx,nodes,expand,treecell
i'm implementing the Drag&Drop on a generic TreeView. My purpose is to expand a folder during DragEntered event after a second of stationing, actual code: setOnDragEntered(e -> { TreeItem<TreeItemContent> enteredItem = getSourceItem(e); if(model.isFolder(enteredItem)){ enteredItem.setGraphic(images.getFolderOpened()); enteredItem.setExpanded(true); } e.consume(); }); desired: setOnDragEntered(e -> { TreeItem<TreeItemContent> enteredItem = getSourceItem(e); if(model.isFolder(enteredItem)){ if(dragDuration >= 1...

How to fill a JavaFX Sphere with two Colors


java,css,javafx,javafx-3d
How can I fill in JavaFX a 3D Sphere with a linear gradient like a 2d Circle? I work with the JavaFX Scene Builder. ...

JavaFX8 : Single Controller for 1+1popup scene (Solved)


java,javafx,fxml
After following the tutorial at http://www.javafxtutorials.com/tutorials/switching-to-different-screens-in-javafx-and-fxml/, I have a functioning popup window, however, I am having difficulty figuring out how to interact with it with a controller. From the tutorial, I got the impression that there is to be a shared controller between the two FXML files, but I'm having...

How to accomplish 3 horizontal line menu in fxml


menu,javafx,overlay,fxml
I want to create menu like "Firefox (Three horizontal line - top right side) Menu". I don't know how to create this line of overlay menu in FXML. Have anybody any idea about this? Thank a lot....

FXML: ClassNotFoundException


javafx,fxml,fxmlloader
I'm very new to JavaFX and I'm having problem using my custom class in FXML. The console keeps giving me this exception when trying to load main.fxml: ... 1 more Caused by: java.lang.ClassNotFoundException: sample.View$BoardPane at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ... I created BoardPane class as a subclass of FlowPane in package sample.View and...

How to analyze incoming message (JavaFX on Android)


java,javafx,javafx-2,javafx-8,javafxports
I ported my JavaFX application to my Android device. I want my application to read incoming SMS messages and store it in a database. I found several questions here in StackOverflow but I don't know how to implement in a JavaFX approach. Please help!

How to make a Javafx Image Crop App


java,image,canvas,graphics,javafx
I am building an application for my colleagues to crop image. I use FXML with Scene Builder to build the GUI. The user click a button to choose a image from his computer. Then, the image is shown in the GUI. User can zoom and move in the pane. At...

UI4J - Get the entire document innerhtml


java,javafx,ui4j
Is there a way to get the innerhtml for the entire page, including html, head, body and so on. I am only able to call page.getDocument().getBody().getInnerHTML() ... there is no page.getDocument().getInnerHTML() ... shouldn't there be ?...

Javafx TextField pseudoClassStateChanged method not working


java,javafx
I'm setting PseudoClass to TextField to highlight them when error occurs. The red border appears around TextField only when I click mouse inside it (to put text value), but I need to show border all time. there is how I sets border: element.pseudoClassStateChanged(PseudoClass.getPseudoClass("error"), true); It worked just fine till last...

JavaFX : Button never sets a graphic


java,javafx,controller
EDIT : A MCVE version of my code has been made to help debug it. It reproduces my bug. The purpose of my code is doing a Memory game. Which means that when it is your turn, you "open" a card, then another one. If they form a pair, they...

JavaFX - how to get background color of Tab, Button, etc


java,animation,colors,javafx,background
Problem description: I can't get background of object in JavaFX. I don't mean Shapes, but normal Nodes like Buttons, Tabs and others. I don't know how to access to theirs background color. What I want? I am developing IDE and I want to run Color animation on tab with file...

Opening frame that is under the JavaFX program category


eclipse,video,javafx,jframe,mp4
Most of program is using JFrames throughout the application for all the different windows that can appear. However, I have to play an instructional video for the user inside a JFrame. I couldn't find a way to do this, so I had to make a JavaFX program. Is there a...

FXML file won't load even when file path is correct


java,eclipse,javafx
I am trying to load an FXML file: URL url = getClass().getClassLoader().getResource("/frontEnd/fxml/ModeScreen.fxml"); try { this.value = FXMLLoader.load(url); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } But when I run, I get: NullPointerException: Location is required the path to my fxml file is: src/frontEnd/fxml/ModeScreen.fxml and the path...

How to identify web actions in JavaFX webview?


javascript,webview,javafx
I need to catch the actions like clicks, drag, right-click, double click etc, that are done by the user on JavaFX web view. How to achieve it?

compare items of 2 comboboxes


combobox,javafx,javafx-8
I want to compare the items of 2 comboboxes. Lets say combobox1 has the items ("a", "b", "c", "d") and combobox2 has the items ("b", "c"). I want to check the items and remove them from combobox1 if there is equality. So after comparison combobox1 should have the items ("a",...

How to draw a rectangle over an element on the image using JavaFX?


javafx
I have an image which is displayed on my JavaFX application. Given the coordinates, I must display that part on the image using a rectangle. For example, if there is a textfield on the image and I give the coordinates of the textfield, a rectangle should appear over the textfield...

Present node +LineChart + JavaFX


javafx,linechart
I am using LineChart in the javafx8 and I am able to get the series plotted dynamically in the graph and the symbols plotted for every input. But the problem is I just want to show the symbol for the present node and not for the nodes which are already...

JavaFX TextField : Automatically transform text to uppercase


java,javafx,fxml,keyevent
I have a JavaFX TextField control on my FXMl that looks like this... <TextField fx:id="input_search" onKeyPressed="#keyListener" prefHeight="25.0" prefWidth="197.0" /> I want to automatically change all characters to uppercase when the user is typing. The code in my controller : public void keyListener(KeyEvent event){ //maybe transform the pressed key to uppercase...

creating a 3d array in python does not create array correctly


python,arrays,3d
I wish to make a 3d array by appending each element to the array in a loop, but instead of getting a 3d array I just get a 1d array with more elements in it. I'm working in Python 2.7 I want to get labels = [1,34,u'te],[2,44,u've],[4,43,u'ht] My code so...