Java 3d rotating text snapshot problem

Hi guys !
I have searched for a method which captured a 3d rotating text and print it on the screen ,but i didn`t found it.
I have to this exercise :
Write a Java 3D program showing two panels and a button. The first panel displays a scene of a rotating 3D text string. When the button is clicked, the image of the 3D scene is captured and the still image is displayed in the second panel.
Can anybody help me or write me the source code???
thank you

Only a fool will do your homework for you.
But I can't help noticing that the assignment specifically mentions Java3d, and you're asking on an applet forum. It seems unlikely that you're supposed to implement your assignment as an applet.
Most likely, the assignment tells you how to obtain Java3d. Either that or an earlier hand-out in your class says how to.
You should re-read your assignment and other class notes, get the Java3D library, and then read the Java3D documentation. Write a simple "hello world" type program using Java3d. At that point, this assignment will probably be pretty simple for you.

Similar Messages

  • Help - Rotating text/picture problem in Motion 4!

    Hi, Can anyone help me out? When trying to make text face the camera and rotate like a merry-go-round, the 'face camera' option makes all the characters face the camera as they go around - like this..
    http://i83.photobucket.com/albums/j293/tekiesha/motion4.png
    This is what I'm trying to achieve:
    http://www.5min.com/Video/Motion-3-Cool-Text-Trick-18629411
    Thanks in advance!

    The text engine was rewritten in M4 and works differently.
    Uncheck the Face Camera checkbox. Go to the Format pane of the Text tab. Change the Rotation X value to 90 degrees.

  • Rotated text problem from Word picture into Framemaker 12

    problem copying a Microsoft Word picture with rotated text into Framemaker - the rotated text gets stacked (each letter is individually rotated)

    It's probably due to how Word defines the rotations for the text and FM's import filters handle it differently. It might be easier to re-create the words in FM if it's not too complex. Alternatively, save the page with the graphics from Word as PDF and then import the graphic from the PDF to FM (you can crop and/or trim as needed in Acrobat).

  • Rotate text using java 1.1

    Hi...i need to rotate text using only java 1.1...no Affine Transformations.
    Does anyone ever had to do this?
    Please give some ideas.
    Thanks.

    Hrm. You could always create an extension of Label's paint that provides the super method with a Graphics object and then, in your implementation, paint the rotation yourself...

  • Drawing rotated text revisited.....

    Hello again,
    I've recently started fiddling with an app that had a method to draw Strings at given Points on a custom JComponent, now I'm trying to extend it to draw the same strings, but throw in an angle should the user choose to do so. But... now here's the part thats foxing me, I want the Point specified to be the center of the String....., i've had a couple of goes, but as soon as the rotation comes in, it goes pair shaped (not literally ;-) , metaphorically).
    Here's some of the code I'm working on, feel free to point bad coding and glaringly obvious problems! I'm aware it doesn't quite do "exactly what it says on the tin", but its definitely a step in the right direction. It should work, but it doesn't. Thoughts anyone?
    /** Method to draw a text label to a specified graphics context.
         @param g2 The graphics context to draw to.
         @param text The label text to draw.
         @param font The font in which to draw the label.
         @param color The color of the label.
         @param angle The angle at which to draw , 0 = horizontal, 90 = vertical.
         @param position The Point at which to draw the label.*/
    public static void drawLabel(Graphics2D g2, String text, Font font, Color color, int angle, Point position)
    //get x,y coordinates from Point
    int x = new Double(position.getX()).intValue();
    int y = new Double(position.getY()).intValue();
    //rotate the point by the required angle
    x = (new Double((x*Math.cos(Math.toRadians(angle)))-(y*Math.sin(Math.toRadians(angle)))).intValue());
    y = (new Double((-x*Math.sin(Math.toRadians(angle)))+(y*Math.cos(Math.toRadians(angle)))).intValue());
    // get the current transform
    AffineTransform startMatrix = g2.getTransform();
    // make a new one...
    AffineTransform rotationMatrix = new AffineTransform();
    // set the text layout
    TextLayout tl = new TextLayout(text,font,g2.getFontRenderContext());
    // rotate the shiny new transform
    rotationMatrix.rotate(Math.toRadians(angle));
    // appy it to g2
    g2.transform(rotationMatrix);
    //set the color of the label
    g2.setPaint(color);
    //draw the label
    tl.draw(g2,x,y);
    //restore the transform for g2
    g2.setTransform(startMatrix);
    }Also I haven't sorted the drawing relative to the center of the string bit yet, so any advice on how to do this would be great.
    Cheers,
    Tom

    This is straightforward, once you understand transforms. I'm surprised no one's answered this yet. Here's an example:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    public class TestRotate extends Frame {
        public static void main(String[] args) {
            new TestRotate().setVisible(true);
        private TestRotate() {
            super("Rotated Text");
            addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent e) {
                        System.exit(0);
            setFont(new Font("default", Font.PLAIN, 24));
            setSize(300, 300);
        public void paint(Graphics g) {
            Graphics2D g2d = (Graphics2D)g;
            TextLayout layout = new TextLayout(
                "This is a string to rotate",
                g2d.getFont(),
                g2d.getFontRenderContext());
            Insets ins = getInsets();
            Dimension dim = getSize();
            Point center = new Point(
                ins.left + (dim.width - ins.left - ins.right) / 2,
                ins.top + (dim.height - ins.top - ins.bottom) / 2);
            g2d.translate(center.x, center.y);
            g2d.rotate(Math.PI / 4);
            layout.draw(g2d, -layout.getAdvance() / 2, 0);

  • Missing rotated text in PDF created via FPDF

    Hi guys,
    I have a weird problem which is preventing some rotated text to be viewed in adobe reader, while every other reader like foxit, google pdf viewer and scrib are doing just fine!
    if you create a flyer using following link
    http://www.erupert.ca/classifieds/create_flyer/ad/32_1306248214
    the generated PDF displays just fine in google document viewer but if I download and open the same in Adobe reader the pull tab text (text rorated 90 degrees) vanish, again the PDF is just fine in foxit reader as well!
    What am I doing wrong, any ideas would be much appriciated.
    Also here is the code to rotate text I'm using by extending the FPDF class
    function Rotate($angle,$x=-1,$y=-1)
    if($x==-1) $x=$this->x;
            if($y==-1) $y=$this->y; //echo "{$this->x} - {$this->y}";die();
            if($angle!=0) $this->_out('Q');
            $angle=$angle;
            if($angle!=0)
    $angle*=M_PI/180;
    $c=cos($angle);
    $s=sin($angle);
    $cx=$x*$this->k;
    $cy=($this->h-$y)*$this->k;
    $this->_out(sprintf('q %.5f %.5f %.5f %.5f %.2f %.2f cm 1 0 0 1 %.2f %.2f cm',$c,$s,-$s,$c,$cx,$cy,-$cx,-$cy));
    OS: Windows Any ( >= XP)
    Adobe version X (latest updates)
    Thanks,
    Anupam

    Hello anupam,
    I know this is a particularly old thread, however i thought i'd post the solution here for others who may have been searching around for a solution to this very same problem and come across this thread.
    As George has correctly stated it is an issue with the unbalanced q and Q operators. I recognise the provided piece of code, it is of course a snippet from a generation class such as FPDF or TCPDF or HTML2PDF, the error occurs when the rotation is not returned to 0 before finalising the document.
    i.e. You would have used something like $pdf -> Rotate(270,60,50) or $this -> Rotate(270,60,50) where 270=the degree of rotation , 60=the x coordinate , 50=the y coordinate.
    Once you've completed writing all your text, lines, images, cells you need to make sure to reset the rotate i.e. $pdf -> Rotate(0) prior to Outputting the pdf to screen or saving it as a file.

  • Rotating text without embedding fonts - how?

    No doubt same or similar question was asked and most likely answered but I could not
    find anything that would match...
    I want to draw column headers of my ADG vertically. So, I need rotate column text 90 degree
    and adjust position.
    Is it true that it can be achieved with embedded font only? If it is true how can it be done for
    Unicode code, which includes ranges for Japanese, Chinese, etc characters. The size of
    swf is going to be huge. Several sites like this
    http://www.forestandthetrees.com/2009/06/29/rotating-text-without-embedding-fonts/
    claims that they have a solution for the problem without embedding fonts.
    Note: I am still using Flex 3.3 SDK with no TLF. By the way, do TLF libraries work with
    3.3 SDK.?
    Thanks in advance

    Draw your text onto a bitmap image (or take an ImageSnapshot of a Label), then rotate the image.

  • How to rotate text

    I was told to restate my number's problem as I want to rotate text within a single cell. This is for grade book so the column label can be hidden along with other data.

    ohsster,
    I was also excited by iWorks, and I was planning to adopt it and try to wean myself from Office even before Numbers was announced. I figured I'd just use the Tables within Pages to do my spreadsheet functions, since all the same calculations are available there. After a month of working in iWork, it's obvious that it would be premature to un-install Office for Mac, but I'm still determined to make the switch and I believe that Apple will address the serious issues, like the speed problem, in short order. So, I'm still excited about being closer to shaking the Microsoft dependency.
    Regarding your application, I don't know how large and complicated your design is, but I encourage you to try my suggestion just to get a feel for working with references that span sheets and tables. This, to me, is much easier in Numbers than in Excel. I tried cross-sheet referencing in Excel years ago and found it too complicated, but in Numbers it is as simple as pie. You can build your second table in the same sheet as your first table if you want to keep things close together for that phase, and then just drag the new table to a new sheet when you're done with it. To make a cell in the destination table mirror the entry in the source table, simply type an = sign in the destination cell and then click on the source cell. To replicate the reference in the first destination cell across the first row, highlight that cell and drag the fill handle across the row. Then, with the filled row highlighted, drag the fill handle down the sheet to populate as many rows as you need. This whole process takes only a few seconds. Now you have a copy of the source table that can be independently formatted, labeled and printed after you move it to it's own sheet. This is the Numbers equivalent of setting a Print Area in Excel, except on steroids.
    I hope you don't give up!
    Jerry

  • Cannot rotate text in table cell

    I am using LiveCycle Designer 8. I want to rotate the text in the top row of a table so that the text is displayed vertically. I have created a simple 3 column, 2 row table. I select one of the cells in the top row (I click in the cell and the cell borders are highlighted). When I go to the "Layout" tab the "Rotate to 90", "Rotate to 180" and "Rotate to 270" buttons are "active" (meaning they are not greyed out and when I click on them, they move just as you would expect a button to move). The problem is that the cell does not rotate when I click on any of those three buttons. It's as if Designer simply ignores my click.
    Since I am relatively new to Designer, my first question is: am I going about this correctly? If not, how do I rotate text vertically in a table? If I am doing it correctly, what can I do to fix this problem?
    Thanks.

    Tim, you're not doing anything wrong.  That was a bug in Designer 8 that has since been fixed.  <br /><br />To get around your problem, try manually adding rotate="90" to that particular cell in the XMLSource.<br /><br />So you would have something like:<br /><draw w="30mm" h="22.2238mm" name="Cell1" rotate="90"><br /><br />Steve<br />Adobe Systems

  • Jagged edges on rotated text in Flash

    Does anyone have a good solution for getting rid of jagged edges on rotated text? I have tried the anti-aliasing options but nothing seems to change the jaggedness.
    Any advice is apprecitated.
    Thanks!

    I don't know if this is the problem, but I've seen some display anomalies when using the scroll wheel on the mouse (typically sideways scroll, but it happens with vertical sometimes, too). I know Logitech mice are affected, but I don't believe it's resticted to just the Logitech mice. Im most cases switching to the Hand tool (use the keyboard shortcut Alt/Opt + Spacebar to access it temporarily) and clicking will clear things up again, sometimes for the rest of the editing session. When I see this, though, it affect all pages not just one.
    Does the type clear if you restart ID and reopen the file?

  • How to Rotate Text 90 Degree?

    I tried to rotate text so that it reads from bottom to
    top of the screen (vertically). How to do it?
    I tried w/ Graphics2D and AffineTransform class but fail.
    Here is my code:
    AffineTransform af = new AffineTransform(0.0, 1.0, 1.0,
    0.0, 0.0, 0.0);
    Graphics2D newg = (Graphics2D) g;
    g.setTransform(af);
    g.drawString("Rotated Text", 70.0f, 70.0f);
    Anybody do text rotation please post reply.
    Thanks!

    Turns out the bug still persists, and I post new Q on
    this forum. Please check it out.
    But here is the my entire code, if you would like to see
    and try:
    import javax.swing.DefaultCellEditor;
    import javax.swing.JScrollPane;
    import javax.swing.SwingConstants;
    import javax.swing.JPanel;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.text.NumberFormat;
    import java.text.DecimalFormat;
    import java.awt.Graphics2D;
    import java.awt.geom.AffineTransform;
    public class CompJFC
    static JFrame frame1;
    static final int cWidth = 500;
    static final int cHeight = 500;
    Object[] ctable = {"Usage Graph for Users",
    "Usage Graph for Servers",
    "Usage Graph for Appliances",
    "Top 20 Users (Last 30 Days)",
    "Top 20 Users (Last 60 Days)",
    "Top 20 Users (Last 90 Days)"};
    JComboBox ccombo = new JComboBox(ctable);
    JPanel panel1, panel2, panel3;
    JCanvas canvas;
    public class JCanvas extends JComponent
    Insets insideBorder;
    JCanvas()
    super();
    JCanvas(int cWidth, int cHeight)
    insideBorder = new Insets(cHeight-150, 50, 50, cWidth-60);
    public void paintComponent(Graphics g)
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D) g;
    AffineTransform af1 = g2.getTransform();
    int xp = insideBorder.left-35;
    int yp = insideBorder.top-100;
    AffineTransform af2 =
    AffineTransform.getRotateInstance(Math.toRadians(270), xp, yp);
    g2.setTransform(af2);
    g2.drawString("Number of Online Users", xp, yp);
    g2.setTransform(af1);
    public void AddComp()
    panel1 = new JPanel();
    panel1.add(ccombo);
    ccombo.addItemListener(new ItemListener()
    public void itemStateChanged(ItemEvent evt)
    String selected;
    panel2.remove(canvas);
    canvas = new JCanvas(cWidth, cHeight);
    panel2.add(canvas, BorderLayout.CENTER);
    panel2.repaint();
    frame1.setVisible(true);
    canvas = new JCanvas(cWidth, cHeight);
    panel2 = new JPanel(new BorderLayout());
    panel2.add(canvas, BorderLayout.CENTER);
    panel3 = new JPanel(new BorderLayout());
    panel3.add(panel1, BorderLayout.NORTH);
    panel3.add(panel2, BorderLayout.CENTER);
    JTabbedPane tpane = new JTabbedPane();
    tpane.addTab("Chart", panel3);
    frame1.getContentPane().add(tpane);
    public static void main(String args[])
    CompJFC jc = new CompJFC();
    frame1 = new JFrame("Swing GUI Exercise");
    frame1.setSize(cWidth, cHeight);
    frame1.setDefaultCloseOperation(frame1.EXIT_ON_CLOSE);
    frame1.getContentPane().setLayout(new BorderLayout());
    jc.AddComp();
    frame1.setVisible(true);

  • Smartforms: new barcodetechnology - additional (rotated) Text

    Dear community,
    I've a small problem while designing a new smartform form. I want to print a code 128 and I already created it with SE73 as a "system barcode" and I also chose the "new barcode technology" and  as alignment "rotated".
    In my form I defined the data for the barcode and formated them with the barcode data (deined in a smartstyle). When printing the form I get the barcode as defined.
    But here comes my problem: I just get the barcode without any text. Is it possible to print a rotated text among the barcode? Is it a configuration in the barcode definition, or have I got to set some printcontrols?
    Please help me to solve this problem!
    Many thanks in anticipition...
    Christian

    Please help me! is there nobody with an idea?
    Hope for answers...
    Christian

  • Rotating text

    is there a method that will rotate the text? I am new to java and cannot figure out how to do this. Help please!
    Mike

    Hi,
    Try doing a forum search for 'rotating text'. I tried it a minute ago, and came up with all kinds of information you might find useful.
    Hope that helps.

  • Text box problem or question

    I'm having the text field problem. I have two text boxes (inside my .fla file) one i can add more text without the box expanding and can  then select the text and croll down to view the missing text and the other one just gets longer the more text I add. I'm trying to duplicate the text box that does not expand the more text I add to it.
    All the settings in the properties are the same on both and I've tried it in MX and CS3 and the both have the same properties in both.
    I'm stumped can anyone help.
    I'm attaching the file.
    Thanks!

    If you right click the textfield on the stage you can select the "scrollable" option for it.  Another option to duplicate the textfield is to copy/paste it.

  • Java.exe has encountered a problem and needs to close.

    I installed Oracle8i on my P4 then when I reboot I get the error "java.exe has encountered a problem and needs to close." even if I click on "don't report" if keeps popping up, anything to do to resolve this?
    Thanks.

    Hello...
    i had the same problem. then when i searched oracle documentation, it suggested as follows:
    1. go to your %ORACLE_HOME%\Apache\Apache\conf\httpd.conf
    2. comment out 2 lines that has
    include ....\jserv.conf
    include ....\oracle_apache.conf
    so your new line will be:
    #include ....\jserv.conf
    #include ....\oracle_apache.conf
    Those lines are at the end of the file.
    3. save the file.
    4. reboot your machine.
    that solution works for me.. hope it works for you too.
    GOOD LUCK!
    --Melani                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • How to delete the "Appended" custom structure in VBAK?

    Hi All, I have appended a : structure ZZLAND1    Component: ZZLAND1 (Domain: LAND1). Now I want to delete the structure that I just appended, so I did: 1.  SE11 -> VBAK -> Append Structure Button -> Select ZZLAND1 --> Delete 2.  To further ensure tha

  • Giving users control of their own distribution list control to add or remove external email addresses from their list

    We are a Exchange 2010 SP3 shop, we have distribution groups (with over 200 email addresses ) from another email system which has only external email addresses (i.e [email protected] [email protected]  and so on -..) We want to import these groups in

  • Airplay mirroring not working as expected

    Hi, Both the Audio and Mirroring function with airplay isn't working for me. I just can't select my Apple TV as an audio source and the Mirroring function just sends a screenshot before turning itself off. Anyone with similar experiences? EDIT: AirPa

  • Cf8/9 - Best method for a site wide pop-up?

    I'm curious what developers here use for a site wide pop-up? cfwindow looks like a good option because of the the modal option. I'm looking to pass in a few values to the pop-up window and call it from anywhere in my site. Does anyone have any exampl

  • Tomcat 4.2 is not loading a class in jar file

    Hi All, I have a java class B in a jar file which is in tomcat's lib directory. I am trying to instantiate class B from class A which is in the same jar file. But I am unable to create an instance of class B and the control in the program simply adva