Java_chic needs help please!!!!!!
Hi.
I have two programs, BGroup.java, which creates a rotating sphere and coloring attributes etc. and some1Canvas3D.java which creates a canvas and simple universe and panel with buttons and works on the BGroup.java program by adding it as a branchgraph to the simple universe "simpleU.addBranchGraph(new BGroup());". what i'd like to do is that if one of the buttons in some1Canvas3D.java is pressed then i want to decrease/increase the radius size of the sphere in BGroup.java. and see this within the canvas.
I'm not Interested in what the program does but only how interaction between two programs work.
If anyone has any ideas how to do this, that'd be great.
The code for the two programs is below . i'm quite new to Java3D so i hope it makes sense.
Thanks for you help.
Sharon
/********BGroup.java****************
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import com.sun.j3d.utils.image.TextureLoader;
public class BGroup extends BranchGroup
public BGroup()
/*create the transformGroup and set the capability to write.needed for rotation*/
TransformGroup someGroup = new TransformGroup();
someGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
//add the transform group to the branchgroup
this.addChild(someGroup);
//create the sphere and add it to the scene
Sphere mysphere = new Sphere(0.5f);
someGroup.addChild(mysphere);
// Create a light that shines for 100m from the origin
Color3f light1Color = new Color3f(7f, 2.6f, 4.1f);
BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
Vector3f light1Direction = new Vector3f(9.0f, -7.0f, 5.0f);
DirectionalLight light1 = new DirectionalLight(light1Color, light1Direction);
light1.setInfluencingBounds(bounds);
someGroup.addChild(light1);
Transform3D yAxis = new Transform3D();
Alpha rotationAlpha = new Alpha(-1, 4000);
RotationInterpolator rotator =
new RotationInterpolator(rotationAlpha, someGroup, yAxis,
0.0f, (float) Math.PI*2.0f);
rotator.setSchedulingBounds(bounds);
someGroup.addChild(rotator);
this.compile();
*********************some1Canvas3D.java******************/
import java.awt.*;
import java.awt.GraphicsConfiguration;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.universe.*;
import com.sun.j3d.utils.geometry.*;
import javax.media.j3d.*;
import java.applet.*;
import java.awt.event.*;
import java.awt.event.WindowAdapter;
public class some1Canvas3D extends Applet {
private Button go = new Button ("Forward");
private Button go2 = new Button ("Left");
private Button go3 = new Button ("Right");
private Button go4 = new Button ("Back");
private Button go5 = new Button ("Do it for me !!!");
public void init()
setLayout(new BorderLayout());
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
Canvas3D c1 = new Canvas3D(config);
c1.setSize(256,256);
add("Center", c1);
SimpleUniverse simpleU = new SimpleUniverse(c1);
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.addBranchGraph(new BGroup());
Panel p = new Panel();
p.add(go);
p.add(go2);
p.add(go3);
p.add(go4);
p.setBackground(Color.blue);
p.setForeground(Color.red);
add("North",p);
Panel p2 = new Panel();
p2.add(go5);
p2.setBackground(Color.blue);
p2.setForeground(Color.red);
add("South",p2);
public void start() {
public void destroy() {
public void run() {
//Explains what happens when the Mouse is clicked on the Applet
public void actionPerformed(ActionEvent e) {
if (e.getSource()==go ) {
/*when this button is pressed i want to be able to decrease the radius size of the sphere in BGroup.java*/
public static void main(String []args)
System.out.println("Program Started");
new MainFrame(new some1Canvas3D(), 750,500);
*************************/
One of the approach you might take regarding this program is : taking off the previous sphere whenever decrease or increase button is hit, then replace it with a new sphere with appropriate size "bigger or smaller".
I don't know how to do it yet as I'm still in my 2nd or third week of Java3d learning "I'd call it fooling around :D", but if I get a chance, I might give it a shot :)
Similar Messages
-
How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please. Thanks
Si vous avez utilisé la commande Save As Template depuis Pages, il y a forcément un dossier
iWork > Pages
contenant Templates > My Templates
comme il y a un dossier
iWork > Numbers
contenant Templates > My Templates
Depuis le Finder, tapez cmd + f
puis configurez la recherche comme sur cette recopie d'écran.
puis lancez la recherche.
Ainsi, vous allez trouver vos modèles personnalisés dans leur dossier.
Chez moi, il y en a une kyrielle en dehors des dossiers standards parce que je renomme wxcvb.template quasiment tous mes documents Pages et wxcvb.nmbtemplate à peu près tous mes documents Numbers.
Ainsi, quand je travaille sur un document, je ne suis pas ralenti par Autosave.
Désolé mais je ne répondrai plus avant demain.
Pour moi il est temps de dormir.
Yvan KOENIG (VALLAURIS, France) mercredi 23 janvier 2011 22:39:28
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community -
I am trying like **** to download itunes 10.6.3 (64 bit - Windows 7) and I keep getting "the installer was interrupted before the requested operations for iTunes could be completed. Your systems has not been modified." I NEED HELP, PLEASE!
I got it figured out myself... yaaaaay for me!
-
After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.Urgent.TQ
Izit software or hardware? Confuse:(
Only can use wifi now.
Any way thanks guys for ur suggestion:) amishcake and simes -
Bought a new macbook and want to manually manage music onto my iphone 4s (as it is already full of music from old windows laptop) but when i click 'manually manage' and then 'apply' i get the message saying it will erase everything already on there. Need help please!
Before you sync your iPhone make sure that all the music that was synced to your phonereviously has been copied to your iTunes on the new MacBook Pro. Then when you connect your phone you will be able to either sync all music or select only those playlists that you want on the phone.
-
Hi i need help please i been playing clash of clans over 13 months. And today o realise what someone using my game Centra. Someone playing on my game Clash of Clans. I been change my Apple ID password, email, but doesn't work. Then I playing game I can see what someone else trying connecting to my game And I don't know what to do.So if you can help me please? I don't wanna lose my game.
Contact iTunes
Contact iTunes -
Hi i need help please i been playing clash of clans over 13 months. And today o realise what someone using my game Centra. Someone playing on my game Clash of Clans. I been change my Apple ID password, email, but doesn't work. When I playing game I can see what someone else trying connecting to my game And I don't know what to do.So if you can help me please? I don't wanna lose my game.
Hello Vaidas Vaidas,
It sounds like you are noticing someone else is accessing your Clash of Clans data by playing the game and you have tried to reset your Apple ID password. If you are following the steps outlined in this article:
Apple ID: Changing your password
http://support.apple.com/kb/ht5624
What is preventing you from changing your password? Any error messages or prompts?
Thank you for using Apple Support Communities.
All the best,
Sterling -
i dont know how i got my photos to my ipod touch from my pc and now i wanna delete them but couldn't. so need help. please let me know.
To turn off auto sync - launch iTunes and go to Edit>Preferences>Devices - check the box at the bottom that says - Prevent iPod, iPhones and iPads from syncing automatically. Click OK and then quit iTunes.
Connect your iDevice to your PC.
Launch iTunes,
Click on the device name on the left side of the iTunes Window.
Click on the Photos Tab in the iTunes window on the right.
Untick all of the photos or albums that you want to remove.
Click on Apply in the lower right corner of iTunes
If you untick or uncheck the Sync Photos heading and then click Apply it will remove all of the photos from the device when it syncs. In this screenshot - I have only certain albums and events selected to sync. -
My iPhone 6 can't find my macbook pro on the airdrop list, although everything is in place, bluetooth, wi fi gets, need help please ?
Dear Niel, thank you but my mac is (MacBook Pro (Retina, 15-inch, Early 2013).
and i can send from it to my iPhone , but not vice versa -
After many months of non-use, when I tried to open Photoshop CS4 Extended, I got an error message 148.3. "Licensing for this product has stopped working." I need help, please.
Error "Licensing has stopped working" | Windows
Error "Licensing has stopped working" | Mac OS
Mylenium -
I need help please I keep getting error messega 21 when i try uploading my iPhone 4 s!!!!!!!!! omg some one please tell me if and how to fix this please. thank you!!!
Hopefully this link will help you: http://support.apple.com/kb/HT2109
-
Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.
Hello, I,m having problems with Polish spell check. It says in iPnstruction that this App (pages) should show my writing mistakes. Check spell button is on but but check spell is not working. Need help Please.
-
After updating my Iphone 5 my lock button isnt working well .... Need help please ..
First, read here:
https://ssl.apple.com/support/iphone5-sleepwakebutton/
See if your phone is affected. -
hi
i need help please . when i want to buy app from store ask me the security question
but i forgot the answer
so i need to the link to rest answer of security questionThe Best Alternatives for Security Questions and Rescue Mail
a. Send Apple an email request at: Apple - Support - iTunes Store - Contact Us.
b. Call Apple Support in your country: Customer Service: Contact Apple support.
c. Rescue email address and how to reset Apple ID security questions. -
Hi I need help please .... I have my credit card information in my account ... But I wanted to delete & I like too add a App Store card
Hi, Ajchenicholas.
Credit cards attached to an Apple ID can be removed and payment method changed to none as long as there is not an outstanding balance. The article below will walk you through this process.
iTunes Store: Changing account information
http://support.apple.com/kb/ht1918
You can always add an iTunes Gift Card to your account at any time. Here are the steps that will walk you through adding an iTunes Gift Card.
iTunes Store: How to redeem a code
http://support.apple.com/kb/ht1574
Cheers,
Jason H.
Maybe you are looking for
-
Office 2013 Click to Run - VAMT error: product SKU is not found
We failed to install the retail key for Office 2013 Home and Business Retail through VAMT. Error is: The Software Licensing Service reported that the product SKU is not found. VAMT key install and activation worked fine with other retail products. I
-
Solution to ipod troubles!!!
Green/amber light flashing? Error 1418 message? Ipod not recognized by pc/mac or itunes? Device error? Etc... After wasting several frustrating days, reading and trying out the many options posted in this and numerous other threads (Thanks to all of
-
Fun and games installing Oracle ...
For various reasons we still use Oracle 8.1.7.4 on Solaris 8 (yes yes I know ... it was the version that Noah used to run the Ark but I am stuck with it so please no suggestions about upgrading :-) ) I decided to attempt to install Oracle 8.1.7.4 on
-
Can we refresh RSPCM transaction in background ??
Hi guys, I am working in BI 7 landscape, where there are around 120 process chains. I have included all these chains in the RSPCM transaction to monitor the daily loads. But the problem is that it take around 8 minutes or more to get refreshed in for
-
Archive Link Creation for IXOS
HI, I have an requirement to create custom output using smartform for invoice. Convert output into PDF and create ARCHIVE LINK to store that document into IXOS server. I have finished part upto creating PDF from smartform. Can someone suggest procedu