Java3D: Transform3D.rotX() causing blackness!

Discussion in 'Java' started by Hoagie, Oct 13, 2003.

  1. Hoagie

    Hoagie Guest

    The pain! I've looked over this a hundred times and I don't
    understand it! I'm new to Java3D, so hopefully someone can help me in
    this quick (most likely trivial error).

    I am drawing a QuadArray plane w/ the "stripes.gif" texture (from the
    tutorial) applied to it. I've drawn the plane to be 2 inches (-1,-1
    to 1,1) and 1 inch (0,0 to 1,1). After creating the Shape3D object, I
    add it to the branch group then add that to the Simple Universe.

    The above works great!

    Then I add the follow code just after adding the BG to the simpleU:

    TransformGroup viewPlatform =
    u.getViewingPlatform().getViewPlatformTransform();
    Transform3D viewT3D = new Transform3D();
    viewT3D.setTranslation(new Vector3f(-0.5f, -0.5f, -6.0f));
    //viewT3D.rotX(-0.35f);
    viewT3D.invert();
    viewPlatform.setTransform(viewT3D);

    As is, the above works fine -- it shifts everything "deeper" into the
    screen. But, if I uncomment the 'rotX' line all I get is black! No
    stripes, no nothing. :(

    My understanding of the "ViewPlatformTransform" is a Transform3D that
    affects everything in the universe.

    How can I set both the Translation and rotX (and other translations
    when the time comes) on the platform tranform?

    Thanks for any help!
    Hoagie, Oct 13, 2003
    #1
    1. Advertising

  2. Hoagie

    Rick Guest

    Never did OpenGL in Java mut maybe these are some tips. You're object
    probably still is somewhere but outside you're view.
    First of all, are you sure the origin(center) of you're object is in the
    middle of it? If not, when it rotaties it can rotate outside you're view.
    Check it with just a small rotation (1 degree or something).
    Another possible cause : I guess rotX is based on GLrotate. If you call that
    function everything rotates so you have to reset after you've drawn the
    object. Just rotate back or use some commands to call and push you're
    viewpoint.

    Just some guesses, using this stuff in C / Delphi looks quit different
    because that ain't object orientated.

    Greetings,
    Rick
    Rick, Oct 14, 2003
    #2
    1. Advertising

  3. Hoagie

    P. Flavin Guest

    The proper newsgroups is: comp.lang.java.3d

    | Java 3DTM Interest Group
    |
    | A discussion list, java3d-interest,
    | has been set up for people interested
    | in the Java 3D APIs.
    |
    | We encourage you to use this forum to
    | discuss issues pertaining to the Java 3D API
    | specification and to Java-based 3D graphics.
    |
    | Subscribing to java3d-interest
    |
    | * To subscribe to the java3d-interest list, send email with
    |
    | subscribe java3d-interest YOUR NAME
    |
    http://java.sun.com/products/java-media/3D/forDevelopers/interest_group.html

    Hoagie wrote:
    > The pain! I've looked over this a hundred times and I don't
    > understand it! I'm new to Java3D, so hopefully someone can help me in
    > this quick (most likely trivial error).
    >
    > I am drawing a QuadArray plane w/ the "stripes.gif" texture (from the
    > tutorial) applied to it. I've drawn the plane to be 2 inches (-1,-1
    > to 1,1) and 1 inch (0,0 to 1,1). After creating the Shape3D object, I
    > add it to the branch group then add that to the Simple Universe.
    >
    > The above works great!
    >
    > Then I add the follow code just after adding the BG to the simpleU:
    >
    > TransformGroup viewPlatform =
    > u.getViewingPlatform().getViewPlatformTransform();
    > Transform3D viewT3D = new Transform3D();
    > viewT3D.setTranslation(new Vector3f(-0.5f, -0.5f, -6.0f));
    > //viewT3D.rotX(-0.35f);
    > viewT3D.invert();
    > viewPlatform.setTransform(viewT3D);
    >
    > As is, the above works fine -- it shifts everything "deeper" into the
    > screen. But, if I uncomment the 'rotX' line all I get is black! No
    > stripes, no nothing. :(
    >
    > My understanding of the "ViewPlatformTransform" is a Transform3D that
    > affects everything in the universe.
    >
    > How can I set both the Translation and rotX (and other translations
    > when the time comes) on the platform tranform?
    >
    > Thanks for any help!
    >


    Try smaller rotations, you are probably shifting
    the view so far that the only thing in your world
    has moved outside of your viewing area.

    Learning Java3d by using it with VRML, a simple
    clear text graphics language with a Scenegraph
    hierarchy similar to Java3d's makes learning and
    experimenting with Java3d a little easier.


    Java3d Demos on line with Source code ( Sun's Demos )
    -----------------------------------------------------
    http://www.cs.nps.navy.mil/people/faculty/capps/4470/java3d/examples/
    http://groups.google.com/groups?&group=comp.lang.vrml&selm=


    Interactive Web Animation with Java3d & VRML
    ------------------------------------------------
    http://www.frontiernet.net/~imaging/java3d_and_vrml.html


    -- Paul, Java Developer & Web Animator
    --------------------------------------
    Imgaging the Imagined: Modeling with Math & a Keyboard
    P. Flavin, Oct 14, 2003
    #3
  4. Hoagie

    Hoagie Guest

    On Tue, 14 Oct 2003 13:04:16 GMT, "P. Flavin"
    <> wrote:

    >The proper newsgroups is: comp.lang.java.3d


    I figured there was a 3D group for Java, but my newsgroup
    server doesn't seem to want to carry it. Can't post there. :(

    > Try smaller rotations, you are probably shifting
    >the view so far that the only thing in your world
    >has moved outside of your viewing area.
    >
    > Learning Java3d by using it with VRML, a simple
    >clear text graphics language with a Scenegraph
    >hierarchy similar to Java3d's makes learning and
    >experimenting with Java3d a little easier.


    Thanks for the tips! I'll be sure to take note of them when I
    get back to this problem. I'm working on a different problem now
    which will help with this in the end.

    Thanks!
    Hoagie, Oct 14, 2003
    #4
  5. Hoagie

    Hoagie Guest

    Thanks Rick,

    I think you are right about everything still being there; I
    thought about that earlier today after I had a chance to stop beating
    my head against the wall. :)
    I'm trying to remove the clip distance right now so I can zoom
    in and out of the scene without losing any of the scene... so I can
    find it again.

    Thanks again!

    On Tue, 14 Oct 2003 11:50:46 +0200, "Rick" <>
    wrote:

    >Never did OpenGL in Java mut maybe these are some tips. You're object
    >probably still is somewhere but outside you're view.
    >First of all, are you sure the origin(center) of you're object is in the
    >middle of it? If not, when it rotaties it can rotate outside you're view.
    >Check it with just a small rotation (1 degree or something).
    >Another possible cause : I guess rotX is based on GLrotate. If you call that
    >function everything rotates so you have to reset after you've drawn the
    >object. Just rotate back or use some commands to call and push you're
    >viewpoint.
    >
    >Just some guesses, using this stuff in C / Delphi looks quit different
    >because that ain't object orientated.
    >
    >Greetings,
    >Rick
    >
    Hoagie, Oct 14, 2003
    #5
  6. Hoagie

    Harald Hein Guest

    "Hoagie" wrote:

    > I figured there was a 3D group for Java, but my newsgroup
    > server doesn't seem to want to carry it. Can't post there. :(


    Talk to your admin. And while you talk to him, tell him that
    comp.lang.java is history since 1997 and he should consider cleaning up
    his server.

    If all else fails go to

    http://groups.google.com/groups?group=comp.lang.java.3d
    Harald Hein, Oct 15, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Ivarson

    Re: Java3d game development

    Richard Ivarson, Jul 10, 2003, in forum: Java
    Replies:
    0
    Views:
    2,305
    Richard Ivarson
    Jul 10, 2003
  2. Hoagie
    Replies:
    1
    Views:
    546
  3. P. Flavin
    Replies:
    0
    Views:
    6,344
    P. Flavin
    Oct 17, 2003
  4. Sheena
    Replies:
    1
    Views:
    383
    Harald Hein
    Oct 28, 2003
  5. Carsten Marx
    Replies:
    1
    Views:
    534
    Eric Sosman
    Jul 25, 2006
Loading...

Share This Page