Show Posts
|
|
Pages: [1] 2 3 ... 5
|
|
1
|
Java Game APIs & Engines / Xith3D Forums / Re: can't smooth a 3ds model
|
on: 2005-05-01 05:56:24
|
Do you plan updating 3DS loader in xith3d-toolkit CVS base? that is, if you managed to fix a sphere problem just mentioned.. Well, I didn't fix the problem yet (don't know if I will, again, I'm no longer actively working on this). I just emailed him some suggestions and alternatives. However, if anyone finds out what the problem is, they are of course more than welcome to fix it. A good place to look would be FacesDescriptionChunk. Until then I would just recommend using Xith's primitive's package to make Spheres.
|
|
|
|
|
3
|
Java Game APIs & Engines / Xith3D Forums / Re: can't smooth a 3ds model
|
on: 2005-04-27 02:11:59
|
|
hey, I'm no longer really working on this loader, but send me an email with your model and the code you're using and I'll try to take a look and see what's wrong. This is very strange because I've loaded many sphere's before and I never noticed this. My email: greg -at- kinostudios -dot- com
BTW, what version of 3DS Max are you using?
|
|
|
|
|
4
|
Java Game APIs & Engines / Xith3D Forums / Re: New 3DS Loader for Xith
|
on: 2005-02-20 22:34:33
|
It would be great if you used the demo framework I created as it is renderer independant and consistant with the other demos. I can help out with this if you like. Wait, didn't realize what you meant by this  What demo framework?
|
|
|
|
|
5
|
Java Game APIs & Engines / Xith3D Forums / Re: New 3DS Loader for Xith
|
on: 2005-02-19 14:10:26
|
I already have a demo  Just check the 3DSLoader v1.2 in the documents folder in xith-tk or my website. However it uses the old package names. Right now I'm moving onto some other projects and won't be working much on this loader, but if you have any questions feel free to PM me, or AIM me, or ICQ me 
|
|
|
|
|
7
|
Java Game APIs & Engines / Xith3D Forums / Re: New 3DS Loader for Xith
|
on: 2005-02-18 21:04:19
|
|
Ok, with my limited knowledge of CVS I think I've successfully commited the source to xith-tk/src/org/xith3d/loader3ds/
Um, and I'd like to also say that I've given up on getting the rotation and scaling animation working, if anyone else wants to give it a shot, be my guest.
Edit: If anyone currently using this loader wants to use it using the xith-tk package, you'll have to change your import statements to reflect the new package name: org.xith3d.loader3ds
|
|
|
|
|
10
|
Java Game APIs & Engines / Xith3D Forums / Re: NEW TO XITH 3D
|
on: 2005-02-11 20:54:15
|
|
I don't know about other people, but I find it highly aggravating when someone types in all caps. I can never understand why people do that, it makes you seem new to computers in general--not just xith.
|
|
|
|
|
12
|
Java Game APIs & Engines / Xith3D Forums / Re: Need help with animation in loader
|
on: 2004-12-22 19:32:35
|
|
Because: 1) jME is very different from Xith 2) jME has an exporter for 3DS, which then exports it to an XML file in their own jME format which is then read by a loader. 3) I know what the problem is, and I vaguely know how to solve it, but I'm just tired of trying all these different things, especially when I don't know how the matricies work. I could be overlooking an obvious solution because of this, so I'm going to take a break and learn about Matricies and Quaternions, finish up this other thing I'm working on, and then finish this loader.
|
|
|
|
|
13
|
Java Game APIs & Engines / Xith3D Forums / Re: Need help with animation in loader
|
on: 2004-12-22 18:20:50
|
Hmmm... thanks for the google link  I didn't know exactly what to search for. I found several sites that look pretty complicated mathematically, but I'm in multi-variable calculus right now so I think I should be able to handle it. Also, it seems to me that the loader is loading the wrong pivot point. Rather, when my animator sets the pivot point, what gets changed is the origin of the object (in AxisChunk), while the PivotChunk doesn't, and has some weird small value that's incorrect. I have a bazillion other things to work on right now, and i'm tired of working on this loader when I have other things looming over my head. So I'm going to put it on hold, finish my other stuff, learn about all these matricies and quaternions and what-not, and then maybe in a week finish the bloody thing. Unless someone wants to do it for me, which would be greatly appreciated 
|
|
|
|
|
14
|
Java Game APIs & Engines / Xith3D Forums / Re: Need help with animation in loader
|
on: 2004-12-21 23:58:28
|
|
Mmmm... I don't really want to spend money on this just to learn what the mul method does. If anyone has a good tutorial on this, or could just spare some time to explain to me how the method is used (as I understand, to combine transforms), it'd be greatly appreciated, and would probably help me finish this dang loader faster.
|
|
|
|
|
15
|
Java Game APIs & Engines / Xith3D Forums / Re: Need help with animation in loader
|
on: 2004-12-21 22:40:46
|
|
You know what would probably help, understanding the mul method on all Transform3D's. I know I should know what this is, but I'm completely new to 3D stuff and Xith, and I've gotten this far without it... So, what's the difference between mul and add and what do they do? You might need to explain how these matricies work as well...
|
|
|
|
|
18
|
Java Game APIs & Engines / Xith3D Forums / Re: ui xith3d
|
on: 2004-12-20 14:40:52
|
|
Right, and I don't think Billboards work with the foreground node, not at least not in my tests with Text2D, I had to convert it to a regular shape3d using quad geometry.
|
|
|
|
|
19
|
Java Game APIs & Engines / Xith3D Forums / Need help with animation in loader
|
on: 2004-12-20 02:16:34
|
I need some help with my loader. Position animation works fine, but scaling and rotating don't really work correctly. The way animation works in my loader (or doesn't work  ), is that I have have an AnimationGroup class that contains a reference to the TransformGroup and Transform3D of an object that will be animated. Then a setTime() function is called indirectly by the user of TDSModel (though setCurrentFrame), which calls the setTime function of all AnimationGroups: 1 2 3 4 5 6 7 8 9 10 11 12
| public void setTime(float time) { if (rotTransform != null) rotTransform.setTime(time); if (posTransform != null) posTransform.setTime(time); if (scaleTransform != null) scaleTransform.setTime(time);
objectOfTransform.setTransform(transformOfObject); } |
This, as you can see, calls the setTime function of all the different types of animation. Each of the classes that the setTime is called on, have a reference back to their "parent" AnimationGroup class, so that they can _directly_ manipulate the object's Transform3D. So first the rotation is applied like so: parent.transformOfObject.setRotation(AxisAngle4f). Then posTransform sets the postion like so: parent.transformOfObject.setTranslation(Vector3f). Then scaleTransform sets the scale of the object like so: parent.transformOfObject.setScale(floatScale). Then finally AnimationGroup sets the Transform3D onto the TransformGroup object: objectOfTransform.setTransform(transformOfObject); Now, in animations from models that i'm testing, I'm getting funky results. If I animate just the position, it works fine. However, if I animate just the scaling, then the object scales, but it also moves in some direction (even when the position is not being animated), instead of just scaling in place. And the rotation also does not rotate the object in place, but rather moves and rotates it (again, even with the other two animations off). So obviously I think I'm doing something wrong here, but what is it? If you want to look at the actual code then click my sig and download the loader (even if you already have, I just re-uploaded a "new" v1.2 with the changes in animation. It's currently set to just animate the postion--which it does correctly) Relevant classes: TimedTransform PosTransform RotTransform ScaleTransform AnimationGroup RotationChunk -- enable/disable rotation animation PositionChunk -- enable/disable position animation ScaleChunk -- enable/disable scale animation TDSModel
|
|
|
|
|
21
|
Java Game APIs & Engines / Xith3D Forums / Re: New 3DS Loader for Xith
|
on: 2004-12-18 21:42:16
|
|
Hmmm... the cube_set, which seem like they could be very useful, don't seem to animate. I know translation works in other models but in cube_translation.3ds it doesn't. I tried loading them in the Java3D loader (the one I'm using to port), and it didn't show any animation. Odd... You sure those animate? I don't have any 3D software other than these loaders to test them.
|
|
|
|
|
23
|
Java Game APIs & Engines / Xith3D Forums / Re: ui xith3d
|
on: 2004-12-18 17:54:43
|
Hmm... Nope, can't see the swing components  I'm doing a renderOnce() in a loop instead of startView btw... 1 2 3 4 5 6 7 8 9 10 11 12 13
| f = new JFrame("ui test"); f.getContentPane().setLayout(new BorderLayout()); RenderPeer rp = new RenderPeerImpl(); cp = rp.makeCanvas(f.getContentPane(),800, 600, 32, false); Canvas3D canvas = new Canvas3D(); f.getLayeredPane().setLayout(new BorderLayout()); Panel pan = new Panel(); pan.add(new JButton("click me")); pan.add(new JTree()); f.getLayeredPane().add("South",pan); f.setSize(800, 600); f.setVisible(true); |
|
|
|
|
|
24
|
Java Game APIs & Engines / Xith3D Forums / Re: ui xith3d
|
on: 2004-12-18 17:10:15
|
|
I don't think copy/paste is that important at the moment. What is really needed though are just text fields that can accept user info, text boxes that can store chat conversation with a transparent background, etc.
|
|
|
|
|
25
|
Java Game APIs & Engines / Xith3D Forums / Re: New 3DS Loader for Xith
|
on: 2004-12-18 17:00:30
|
I've updated the code and javadoc some, and added it to the xith-tk documents and file folder. From now on you should download it from there (or from CVS whenever I get around to putting it there), however, I will still try keeping the files on my site in sync, and the javadoc is online there for you to look at. You can try animating your stuff now, but it won't work too well  It only animates position so far, implementing rotation and scaling shouldn't be too hard but I'm waiting for my 3D modeler to give me a nice test file. Also, I think the position coords are off a bit and probably need to be converted to xith-space. This will be done soon hopefully, but I'm really busy right now, if anyone can take a look at the code the important classes are: AnimationGroup -- Basically finished TimedTransform -- ignore the setTransform method, gonna get rid of it cause the Transform subclasses should manipulate the Transform3D in AnimationGroup directly (see PosTransform). PosTransform -- Basically finished. RotTransform -- not yet changed (kev glass's code) ScaleTransform -- Does it work now? PositionChunk -- needs coordinate conversion probably ScaleChunk -- Probably finished? RotationChunk -- not yet touched TDSModel -- animations are controlled here by the user. Edit: OK, I think I might have fixed the position stuff, so now hopefully it's in the right coords. I've also added Scale animation, but I don't have any models that scale stuff so I can't test it. It might or might not work. Either way, that's practically finished, so the last thing to do is the RotationChunk/RotTransform.
|
|
|
|
|
27
|
Java Game APIs & Engines / Xith3D Forums / Re: Spheric Texturing
|
on: 2004-12-18 14:33:13
|
Uh, I don't know if this is what you need, but this makes a sphere with the proper texcoords: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
| public static Geometry getSphere(int divisions, int radius) { float sign = 1.0f;
float[] texCoords = new float[(divisions + 1) * (2 * divisions + 1) * 2]; float[] vertices = new float[(divisions + 1) * (2 * divisions + 1) * 3]; float[] normals = new float[(divisions + 1) * (2 * divisions + 1) * 3];
for (int i = 0;i <= divisions;i++) { float rho = (float)((double)i * FastMath.PI / (double)divisions);
for (int j = 0;j <= 2 * divisions;j++) { float theta = (float)((double)j * FastMath.PI / (double)divisions); float vx = (float)(FastMath.cos(theta) * FastMath.sin(rho)); float vy = (float)(sign * FastMath.cos(rho)); float vz = (float)(FastMath.sin(theta) * FastMath.sin(rho));
texCoords[((i * (2 * divisions + 1)) + j) * 2 + 0] = 1f - (float)j / (2f * divisions); texCoords[((i * (2 * divisions + 1)) + j) * 2 + 1] = (float)i / divisions;
vertices[((i * (2 * divisions + 1)) + j) * 3 + 0] = vx * radius; vertices[((i * (2 * divisions + 1)) + j) * 3 + 1] = vy * radius; vertices[((i * (2 * divisions + 1)) + j) * 3 + 2] = vz * radius;
normals[((i * (2 * divisions + 1)) + j) * 3 + 0] = vx * sign; normals[((i * (2 * divisions + 1)) + j) * 3 + 1] = vy * sign; normals[((i * (2 * divisions + 1)) + j) * 3 + 2] = vz * sign; } }
int[] vIdx = new int[divisions * 2 * divisions * 6]; int n = 0;
for (int i = 0;i < divisions;i++) { for (int j = 0;j < 2 * divisions;j++) { int v00 = i * (2 * divisions + 1) + j; int v01 = i * (2 * divisions + 1) + j + 1; int v10 = (i + 1) * (2 * divisions + 1) + j; int v11 = (i + 1) * (2 * divisions + 1) + j + 1;
vIdx[n++] = v11; vIdx[n++] = v10; vIdx[n++] = v00; vIdx[n++] = v11; vIdx[n++] = v00; vIdx[n++] = v01; } }
IndexedTriangleArray shapeGeom = new IndexedTriangleArray(vertices.length / 3, GeometryArray.TEXTURE_COORDINATE_2 | TriangleArray.COORDINATES | TriangleArray.NORMALS, vIdx.length);
shapeGeom.setTextureCoordinates(0, 0, texCoords); shapeGeom.setValidVertexCount(vertices.length / 3); shapeGeom.setValidIndexCount(vIdx.length); shapeGeom.setCoordinates(0, vertices); shapeGeom.setNormals(0, normals); shapeGeom.setIndex(vIdx);
return shapeGeom; } |
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|