I'm a new comer here. I want to draw a polygon cylinder using java3d. the cylinder can interactively rotate aroud x-axis,y-axis,or z-axis.Any opion will be appreciated.
yo. its not done.
you have created a triangle cylinder. not a polygon cylinder.
ten lashes . you give up too easily. go back and
make a real polygon cylinder out of quad arrays strips
indexeded or otherwise.
What I do is : 1. construct polygon cyliner side face using IndexedTriangleStripArray. Though I think I can use IndexedQuadArray ,there is a weakness because u cannot reuse vertex.There is not "IndexedQuadStripArray" here.2.construct polygon cylinder top and down face using IndexedTriangleStripArray.Also I can use IndexedTriangleArray or IndexedQuadArray,but vertex is much more.
do u still think my way is triangle cyliner? If so,tell me ur way.Thanks.
i reckon that if all you want to do is create a cylinder. then the utils cylinder should do it. all the animation
is up to you. you can do it with alpha classes
i reckon that the default geometry creates a plygon cylinder but i asm not sure
Message was edited by: geoff
I found a weakness in my way.when the polygon is concave(not protruding),the top and down triangle face will be error.
Using alpha and cylinder class can produce polygon cylinder? I dont know how to do.could u provide me some code?
ps: My problem is :know the polygon coordinates ,and extrude the polygon to a polygon cylinder.dont need animation ,just interactively rotate and scale.
Sorry, most of the folks here are busy with their own projects and cannot
provide code to everyone that asks.
If you are just looking to create a cylinder, there is a Cylinder utility
class in the Java3D utilities. If you need to create a custom shape, take a
look at the code, it is available.
As for the rotating and scaling, place two transform groups above the shape
in the scenegraph and modify the transform matrix on these groups. You can
also use the mouse behaviors that come with Java3D for a quick start.
If you are still confused as how to generate the cylinder geometry, I
recommend searching the web for opengl or basic geometry examples. Java3D is
just a scenegraph, you need your own algorithms to create the geometry you
want in 3D coordinates.
Hope that helps,
Sent: Wednesday, August 25, 2004 4:25 AM
Subject: [JAVA3D-INTEREST] Re: how to draw a polygon cylinder using java3d
I found a weakness in my way.when the polygon is concave(not protruding),the
top and down triangle face will be error.
Using alpha and cylinder class can produce polygon cylinder? I dont know how
to do.could u provide me some code?
ps: My problem is :know the polygon coordinates ,and extrude the polygon to
a polygon cylinder.dont need animation ,just interactively rotate and scale.
[Message sent by forum member 'hrliuhai88' (hrliuhai88)]
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Yes,you are right.I solving the problem using class GeometryInfo and Triangulator . thanks again.
sorry to confuse you witht he alpha nonsense. i got it in my head that you wanted to animate this cylinder.
for interactive manipulation i reckon that you look at
com.sunj3d.utils.mouse. these are pretty good and can cater for most maipulation. in fact i think they are brilliante. mouse rotate and mouse translate seem to be all i need. i can get a good scan of any object just using those two.
let me know what you think??
copy this into top of file..
copy this after all structure of enviroment. like all grafics config..
KeyNavigatorBehavior keyNavBeh = new KeyNavigatorBehavior(TG);
keyNavBeh.setSchedulingBounds(new BoundingSphere(new Point3d(),1000.0));
BoundingSphere behaviorBounds = new BoundingSphere(new Point3d(),
MouseRotate mr = new MouseRotate();
MouseTranslate mt = new MouseTranslate();
MouseZoom mz = new MouseZoom();
mz.setTransformGroup(myTG);// replace TG
then add to the tranform you want to manipulate.
that shoulf give you loads of object maniptulation. if that isnt enough you are on yuor own. its enough for me.
i would go to url below and have a look at the tutorials there.
Thanks.I created a geometry using IndexedTriangleStripArray class.It's done.
also ,www.j3d.org is good site for java3d
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.