|
||||||||||||||
| ISBN: 3423050012 ISBN: 3423050012 ISBN: 3423050012 ISBN: 3423050012 | ||||||||||||||
|
|
Wir empfehlen: | |||||||||||||
public class RGB extends Applet { Browser browser = null; Node material = null; EventInSFColor diffuseColor = null; float[] color = new float[3]; public void init() { // Drei simple Buttons zur Farbänderung add(new Button("Red")); add(new Button("Green")); add(new Button("Blue")); // Instanz des Browsers erstellen browser = Browser.getBrowser(this); // Instanz des Material-Knotens material = browser.getNode("MAT"); // Instanz des Appearance-Knotens diffuseColor diffuseColor = (EventInSFColor) material.getEventIn("set_diffuseColor"); }public boolean action(Event event, Object o) { // Auf Benutzereingaben reagieren if (event.target instanceof Button) { Button b = (Button) event.target; if (b.getLabel() == "Red") // Der rote Button wurde betätigt { color[0] = 1f; color[1] = 0f; color[2] = 0f; diffuseColor.setValue(color); } else if (b.getLabel() == "Green") // Der grüne Button wurde betätigt { color[0] = 0f; color[1] = 1f; color[2] = 0f; diffuseColor.setValue(color); } else if (b.getLabel() == "Blue") // Der blaue Button wurde betätigt { color[0] = 0f; color[1] = 0f; color[2] = 1f; diffuseColor.setValue(color); } } return true; } }
|
||||||||||||||
|
Back to the topic sites: ScientificPublication.com/Startseite/Informatik/Programmieren StudyPaper.com/Startseite/Computer/Internet StudyPaper.com/Startseite/Computer External Links to this site are permitted without prior consent. Publication List: Scalable Vector Graphics (automatische Übersetzung) Scalable Vector Graphics 1.1 (automatische Übersetzung) | ||||||||||||||
| Home | deutsch | Set bookmark | Send a friend a link | Copyright © | Impressum | ||||||||||||||