YoyoApp.java example In the J3D package...

YoyoApp.java example In the J3D package...
private Geometry yoyoGeometry() {
TriangleFanArray tfa;
int N = 17; //This mean 17 vertexs right?
int totalN = 4*(N+1); //What is this mean?
Point3f coords[] = new Point3f[totalN];
int stripCounts[] = {N+1, N+1, N+1, N+1};//
And what is this?Thank you.
float r = 0.6f;
float w = 0.4f;
int n;
double a;
float x, y;

If i remember correctly:
N = total vertices in a single fan (not including central point)
totalN = total vertices for the whole yoyo (4 fans so 4*(n+1) total ).
int stripCounts[] = {N+1, N+1, N+1, N+1}
Specifies 4 fans (since array of length 4) each with N+1 vertices.
Basically there is one TriangleFanArray, but this allows multiple triangle fans within it. The coords are stored in one long array and the stripCounts specifies how many individual fans and how long they all are.

Similar Messages

  • Wsdlc Ant Task - Problem creating java files in the correct package

    In eclipse, for weblogic 9.2
    Using the wsdlc WebLogic Web Services Ant Task, I am trying to auto-generate the java files for the web service based on the WSDL. I have specified the packageName as one of the parameters. However the java files are being created and packaged based on the TargetNameSpace of the WSDL rather then under the package name specified. Following is part of my build.xml
    autogen.src.dir=../code/java/beaAutoGen
    base.dest=../../../var/build/wsmToPlmWS
    bea.build.dir=beaBuild
         <target name="generate-from-wsdl" depends="prepare">
              <delete dir="${src.dir}" includeemptydirs="true" />
              <delete dir="${autogen.src.dir}" includeemptydirs="true" />
              <wsdlc srcWsdl="../config/sourceWSDL/MRPBindingPort.wsdl"
                   destJwsDir="${base.dest}/${bea.build.dir}/compiledWsdl" destImplDir="${base.dest}/${bea.build.dir}/impl"
                   packageName="com.lmco.iplm.webservices.wsmtoplm" debug="on"
                   srcServiceName="WSPlmMto_Service"
                   debugLevel="DEBUG" autoDetectWrapped="true" jaxRPCWrappedArrayStyle="true"
                   verbose="on" classpathref="bea-classpath" />
    <!-- unjar to get the all the details so we can tokenize -->
              <unjar dest="${autogen.src.dir}"
                   src="${base.dest}/${bea.build.dir}/compiledWsdl/MRPBindingPort_wsdl.jar" />
    <!-- copy over the impl file -->
              <copy todir="../code/java/src">
                   <fileset dir="${base.dest}/${bea.build.dir}/impl" />
              </copy>
         </target>

    In eclipse, for weblogic 9.2
    Using the wsdlc WebLogic Web Services Ant Task, I am trying to auto-generate the java files for the web service based on the WSDL. I have specified the packageName as one of the parameters. However the java files are being created and packaged based on the TargetNameSpace of the WSDL rather then under the package name specified. Following is part of my build.xml
    autogen.src.dir=../code/java/beaAutoGen
    base.dest=../../../var/build/wsmToPlmWS
    bea.build.dir=beaBuild
         <target name="generate-from-wsdl" depends="prepare">
              <delete dir="${src.dir}" includeemptydirs="true" />
              <delete dir="${autogen.src.dir}" includeemptydirs="true" />
              <wsdlc srcWsdl="../config/sourceWSDL/MRPBindingPort.wsdl"
                   destJwsDir="${base.dest}/${bea.build.dir}/compiledWsdl" destImplDir="${base.dest}/${bea.build.dir}/impl"
                   packageName="com.lmco.iplm.webservices.wsmtoplm" debug="on"
                   srcServiceName="WSPlmMto_Service"
                   debugLevel="DEBUG" autoDetectWrapped="true" jaxRPCWrappedArrayStyle="true"
                   verbose="on" classpathref="bea-classpath" />
    <!-- unjar to get the all the details so we can tokenize -->
              <unjar dest="${autogen.src.dir}"
                   src="${base.dest}/${bea.build.dir}/compiledWsdl/MRPBindingPort_wsdl.jar" />
    <!-- copy over the impl file -->
              <copy todir="../code/java/src">
                   <fileset dir="${base.dest}/${bea.build.dir}/impl" />
              </copy>
         </target>

  • Problems with jsresources SingleChannelStereoAudioInputStream.java example

    I've noticed something quite peculiar with the SingleChannelStereoAudioInputStream.java example. The algorithm seems to be able to place the mono waveform on either the left or right channel (I confirm this using the Adobe Audition waveform display), but instead of leaving the other channel completely silent, it creates a periodic noise spike every other couple of seconds. I've tried this with many mono audio files with the same results. Has anyone else experienced this?
    Thanks in advance.

    Thanks for the quick reply.
    Unfortunately, whether sm_bOptimizeSilenceWriting is set to true or false, the results are the same. I'm not quite sure which array they're referring to when they state: +"This assumes that the array has been filled with 0's outside of this class, which is often the case."+
    The only array from the code (*m_abSilenceSample*) that seems to be filled with 0's in this example is the following:
    // A silence sample (mono) in byte representation of this stream.
    private byte[] m_abSilenceSample;
    int nSampleSizeInBytes = getFormat().getFrameSize() / 2;
    m_abSilenceSample = new byte[nSampleSizeInBytes];
    // For signed PCM representation, the values of the array
    // m_abSilenceSample are left with the initial value 0 (this
    // represents silence). For unsigned 8 bit, the value 128
    // represents silence. Therefore, the (single) byte is
    // initialized with this value. Unsigned formats with more
    // than 8 bits are not supported.
    if (getFormat().getEncoding().equals(AudioFormat.Encoding.PCM_UNSIGNED)) {
       if (getFormat().getSampleSizeInBits() == 8) {
          m_abSilenceSample[0] = (byte) 128;
       } else {
          throw new IllegalArgumentException("unsigned formats are only supported for 8 bit");
    }Unfortunately, it doesn't seem to be used in the read() portion of the code.

  • Generate Java option for PL SQL packages

    Hi
    I recently found out that there is a 'generate java' option in the JDeveloper IDE for PLSQL packages, which creates a Java representation of the PLSQL package.
    What is the use of doing this? can anyone share tutorials that makes use of this feature

    This link may helpful
    Oracle PL/SQL Package - DB Adapter

  • Trouble compiling java files inside the packages.

    Hello I have a question in Java when compiling with packages. Can anyone Help??
    My 2 java files BeerSelect2.java & BeerExpert.java are in packages com.example.web & com.example.model respectively.
    C:\MyProjects\beerV1\src\com\example\web\BeerSelect2.java
    and
    C:\MyProjects\beerV1\src\com\example\model\BeerExpert.java
    I have compiled the BeerExpert.java in the model package.(ie the class file for BeerExpert is in the com.example.model package.)
    My BeerSelect2 file which is inside the web folder is like this
    package com.example.web;
    import com.example.model.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class BeerSelect2 extends HttpServlet
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
    response.setContentType("text/html");
    PrintWriter out=response.getWriter();
    out.println("Beer Selection Advice<br>");
    String c=request.getParameter("color");
    out.println("<br> Got Beer color "+c);
    BeerExpert be=new BeerExpert();
    List result=be.getBrands(c);
    response.setContentType("text/html");
    out.println("BEER SELECTION ADVICE <br>");
    Iterator it=result.iterator();
    while(it.hasNext())
    out.print("<br> try: "+it.next());
    This shows 3 comile errors.
    & the BeerExpert.java file which is in the model folder is like this:
    package com.example.model;
    import java.util.*;
    public class BeerExpert
    public List getBrands(String color)
    List brands=new ArrayList();
    if(color.equals("amber"))
    brands.add("Jack Amber");
    brands.add("Red Moose");
    else
    brands.add("Jale pale Ale");
    brands.add("Gout Stout");
    return (brands);
    This compiles fine in the model folder.
    Now when I'm trying to compile my BeerSelect2.java in the 'web' folder in which I'm trying to import the com.example.model.* which is as follows
    C:\MyProjects\beerV1\src\com\example\web>javac BeerSelect2.java
    which gives 3 errors like this
    BeerSelect2.java:3: package com.example.model does not exist
    import com.example.model.*
    ^
    BeerSelect2.java:22:cannot find symbol
    symbol: class BeerExpert
    location: class com.example.web.BeerSelect2.
    BeerExpert be=new BeerExpert();
    ^
    BeerSelect2.java:22:cannot find symbol
    symbol: class BeerExpert
    location: class com.example.web.BeerSelect2.
    BeerExpert be=new BeerExpert();
    ^
    Can anyone help???

    Since the classes are part of the com.example.web and com.example.model packages the most straight forward way to compile is from the folder containing "com". Assuming you want the resulting .class files to be in the same folders are their associated .java source files:
    C:\MyProjects\beerV1\src\> javac -cp . com\example\model\BeerExpert.java
    C:\MyProjects\beerV1\src\> javac -cp . com\example\web\BeerSelect2.javaThe -cp . part is there to set the classpath (the location that the compiler will use to locate java classes) and thereby let the compiler make sense of the import statements.
    The presence of "src" in the directory path strongly suggests, however, that the intention is not to have source and class files end up in the same directory. If this is the case read up on the syntax of the http://download.oracle.com/javase/6/docs/technotes/tools/windows/java.html (java.exe) and http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html (javac.exe) commands. (paying attention to how searching for types is done). Also read up on any documentation you were given for building the application (if you are modifying something already given).
    If you are using an IDE you should say.

  • Reaching the java file outside the package?

    Hi how can i reach the java(or class) files outside the packge(i mean one top folder)
    For example i have a java file in a folder named tech and i want to reach a java file in the folder named support which is under tech folder is something like that possible if it is how?

    Then tech should also be in a package.
    So it would be..
    package tech;
    import tech.support.*;and
    package tech.support;
    import tech.*;

  • Is the Java Card Platform supports the unnamed package?

    1.agree
    Virtual Machine Specification for the Java Card� Platform, Version 2.2.1 chapter 2.2.2.1:
    "packages in the Java Card platform are used exactly the way they are in the Java platform."
    That means the Java Card platform also have two type package,named package and unnamed package.
    2.against
    Development Kit User�s Guide for the Java Card Platform, Version 2.2.1 chapter Running the Converter:
    "Command line usage of the Converter is:
    converter [ options] <package_name> < package_aid> < major_version>.
    < minor_version>"
    The above formula tells us that the <package_name> is a MUST Line Arguments of converter.But if we create a unnamed package,how should we express it?
    3.against
    first,How a real JCVM intall/organize the unnamed packages?
    second,In a real JCVM run-time environment,all java items(include attribute,method and soon) refered by the suit of package+class+item.In this condition,the item in a nunamed package cannot offers the package and is never refered.
    I have been botherd by the above 3 boresome and opposite points for some time and cannot give out the key of the question.
    Can some one give me some ideas?
    thx!

    Sun's kit is free. There is a reference implementation of the JC Runtime environment with the kit.
    You of course can't load that onto a card. And even if you had the RE, you won't be able to load onto a card because the RE is burned into the ROM which you don't have low level access to.
    Read the JCRE specs that come with the kit

  • Java plug in 1.4.1_04 the install package could not be opened

    Hi .
    I am trying to install java plug in 1.4.1 on a Windows XP client SP1 and I receive the following error.
    Windows Installer
    The installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid windows installer package.

    If you used the online installer, try the offline installer. If you used the offline installer, you might have a damaged install file. Get a new copy and try again.
    Read the Installation Instructions, if you haven't.

  • "error while evaluating Java script for the package"

    Okay, this is a new one on me! Anyone ever get this message? I don't know what is going on with my iMac, all I know is that about a month ago my iTunes was working fine, and when I just went to use it, it tells me "you can not use the application iTunes with this version of Mac OS X. So I thought maybe something was wrong with my iTunes and downloaded it again and i got the "error while evaluating Java script for the package" when I tried to reinstall iTunes. Another issue I am having is with updates. I haven't received an update for a long time and when I manually check, it tells me there are none.

    Okay, this is a new one on me! Anyone ever get this message? I don't know what is going on with my iMac, all I know is that about a month ago my iTunes was working fine, and when I just went to use it, it tells me "you can not use the application iTunes with this version of Mac OS X. So I thought maybe something was wrong with my iTunes and downloaded it again and i got the "error while evaluating Java script for the package" when I tried to reinstall iTunes. Another issue I am having is with updates. I haven't received an update for a long time and when I manually check, it tells me there are none.

  • Is the Swing Package in Java obsolete?

    hey guys,
    i'm just a newbie java enthusiast here and all the while i've been learning to manipulate data in minimal ways using the Swing package especially the JOptionPane class.
    is this class/package already obsolete? a person here in school told me so? well?

    Your friend probably confused it with AWT, -which was used for doing gui stuff back in the dark ages before Swing came along.
    Nowdays people use Swing instead of AWT for doing gui stuff in Java, so awt could in some ways be considered obsolete (except of course that Swing uses quite a bit of awt stuff behind the scenes!)
    If you dont use Swing what will you use for gui?

  • Can I package and call a java object in the swf? (on the client)

    Hello,
    Can I package and call/execute a java object within the
    swf/adobe flash player?
    I want to embed a java object in my swf, and then whne the
    swf executes have it call the java object......
    E.

    ..... there are few instances where it would be nice to
    develope a single java object that can be used on the server and
    the client..... let's say for the case of server side validation,
    that could also be used by the client application for validation,
    instead of having to maintain 2 sets of validation logic in two
    different languages (java and AS).....

  • What are the two packages default imported into all Java classes?

    I just remember one of it is java.lang.* ... What are the others? Thanks for any replies. ^v^

    http://java.sun.com/docs/books/tutorial/java/interpack/usepkgs.html
    For your convenience, the Java compiler automatically imports three entire packages:
    The default package (the package with no name)
    The java.lang package
    The current package by default

  • Could not run the bookstore1 example from the Java Web Services Tutorial

    The bookstore1 servlets example from the Java Web Services Tutorial (issue Aug 1, 2002) was built and deployed successfully by using the deploytool (following the steps described on pages 498ff of the tutorial).
    After deploying the application the Tomcat Web Application Manager shows the entry:
    /bookstore1:stopped:0:D:\Programme\Java\tomcat\jakarta-tomcat-4.1.8\work\Standalone\localhost\manager\bookstore1.war
    when entering the command: http://localhost:8080/manager/list.
    After entering the command: http://localhost:8080/manager/start?path=/bookstore1, the (uncomplete) message appears:
    FAIL - Application at context path /bookstore1 could not
    It should be noted that I was able to build and deploy the application GSApp (chapter 3 of the tutorial) successfully.

    Did you set up the database as described in
    http://java.sun.com/webservices/docs/1.0/tutorial/doc/WebApp13.html#69868

  • How can I use the security package in JCOP41V2.2?

    Hi all, I'm a newbie in javacard programming. I'm trying to develop a project with RSA_signature. But I found, the exception NO_SUCH_ALGORITHM will be thrown out when I new an instance of KeyPair.
    My java file Temp_1.java following:
    package temp;
    import javacard.framework.Applet;
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import javacard.framework.APDU;
    import javacard.security.*;
    * @author lujj
    public class Temp_1 extends Applet {
    KeyPair myKeyPair = null;
         public static void install(byte[] bArray, short bOffset, byte bLength) {
              // GP-compliant JavaCard applet registration
              new Temp_1().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
         public void process(APDU apdu) throws ISOException{
              // Good practice: Return 9000 on SELECT
              if (selectingApplet()) {
                   return;
              byte[] buf = apdu.getBuffer();
              if(buf[ISO7816.OFFSET_CLA] == (byte)0xEE)
                   try
                        myKeyPair = new KeyPair(KeyPair.ALG_RSA, KeyBuilder.LENGTH_RSA_1024);
                   catch(CryptoException e)
                        ISOException.throwIt((short)(0x6F00+e.getReason()));                    
                   return;
              switch (buf[ISO7816.OFFSET_INS]) {
              case (byte) 0x00:
                   break;
              default:
                   // good practice: If you don't know the INStruction, say so:
                   ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    This package can be upload and the applet can be installed successfully.
    But if I send the apdu "EE 00 00 00 00" after selected the applet, "6F 03" will be returned.
    Is there anyone can help me? Thanks a lot.

    Thank you so much~
    Actually, it's only an applet for test. I cannot get the error code if I new the KeyPair in install function or Applet construct function. It will return "6A 80" when install the applet.
    And, I found that it support few algorithm. For example, it does not support ALG_DES_MAC4_ISO9797_M2,etc. Is there anything I can do if I want to use the algorithm? Shall I rewrite security package by myself?
    5555, security package is the standard package in JAVACARD API 2.1.1.

  • Error while executing Java examples

    Hello every 1,
    Whenever I try to compile the java code using commandline, i am getting the same kind of error. Can some one please help me if there is a trick on executing these examples. For instance I compiled this java example given here . compilation is successful. When I try to execute the program, I get the error message, could not find or load mainclass ArrayDemo.
    Appreciate your help.
    Thanks,
    FJ

    Hi -
    When I compile the program using command prompt, I am in C:\Users\Farooq\MyPrograms directory. MyPrograms is where all my programs are.
    Below is the actual program, it does not have package statement.
    class ArrayDemo {
    public static void main(String[] args) {
         int[] anArray; // declares an array of integers
    anArray = new int[10]; // allocates memory for 10 integers
    anArray[0] = 100; // initialize first element
    anArray[1] = 200; // initialize second element
    anArray[2] = 300; // etc.
    anArray[3] = 400;
    anArray[4] = 500;
    anArray[5] = 600;
    anArray[6] = 700;
    anArray[7] = 800;
    anArray[8] = 900;
    anArray[9] = 1000;
    System.out.println("Element at index 0: " + anArray[0]);
    System.out.println("Element at index 1: " + anArray[1]);
    System.out.println("Element at index 2: " + anArray[2]);
    System.out.println("Element at index 3: " + anArray[3]);
    System.out.println("Element at index 4: " + anArray[4]);
    System.out.println("Element at index 5: " + anArray[5]);
    System.out.println("Element at index 6: " + anArray[6]);
    System.out.println("Element at index 7: " + anArray[7]);
    System.out.println("Element at index 8: " + anArray[8]);
    System.out.println("Element at index 9: " + anArray[9]);
    }

Maybe you are looking for

  • Omit first document in a content query

    Hello, I would like a content query web part to skip over the first item in the query and display the subsequent items. So if I'm limiting the web part to three results, I want results 2, 3, and 4, not 1, 2, and 3. I have a sense that something like

  • Mapping lookup up failure with input JavaBean with an array of strings

    To receive input data our Web service defines a JavaBean one element of which is an array of strings. When a test Java client calls the service method the call is completed successfully. When a Perl client calls the service method an exception is ret

  • Why goes my Epson offline?

    frequently my iMac looses the wireless connection with my Epson Stylus SX510W. My wife has an macbook uses the same printer and never has a problem. I have really a hard time to understand why the iMac looses contact. Any help any advises? Karladolf

  • Photo Sharing App

    Our company has 70 sites.  What I am looking for is an app that would allow for mulitple employees to upload photo's from their iPhones to the app and also let each of us the ability to view using one password and username.  Our goal is to upload ima

  • Whatsapp and E63 problem

    Hi. I've been using E63 for the past 3 years. And had whatsapp installed for more than a year. Recently, my phone started slowing down terribly. At first I thought it was a memory problem. So i cleaned up my phone. Also did a hard reset/soft reset an