Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - shadow

Pages: [1]
1
German corner / Re: Ein paar Fragen zu Texturen
« on: July 25, 2011, 01:16:57 am »
Noch mehr Fragen  ???

Dann hab ich noch den einen Baum mit Blender in ein 3ds-File umgewandelt. Jetzt wurde die Textur nicht mehr mit alpha gerendert, ob wohl ich den entsprechenenden Texture-Constructur mit boolean useAlpha = true gewählt habe...

Nochmals danke für die Unterstützung!!


2
German corner / Ein paar Fragen zu Texturen
« on: July 25, 2011, 12:48:59 am »
Hi,

Hintergrund: Ich möchte in mein Level ein paar Bäume von hier reinladen:
http://www.reinerstilesets.de/3d-grafiken/3d-plants/

Den ersten Baum lade ich als OBJ mit Loader.loadOBJ(). Es liegen zwei Textur-Bilder bei, mit denen ich aber vorerst nichts mache. Die Konsolenausgabe verrät mir folgendes:

Code: [Select]
Texture named bushtwig4v2.tga added to TextureManager!
Texture named ahernbark.bmp added to TextureManager!

Aber Texturen werden auf dem Objekt nicht angezeigt. Deshalb lade ich vorher noch die zwei Texturen, und zwar so:

Code: [Select]
TextureManager.getInstance().addTexture("bushtwig4v2.tga", ....);
TextureManager.getInstance().addTexture("ahernbark.bmp", ....);

Allerdings funktioniert das Ganze nur, wenn ich das TGA-Bild in ein PNG umwandle, und das BMP in ein JPG.

Frage 1: Ist das normal, dass BMP und TGA nicht geladen werden kann?
Frage 2: Hätte ich ohne die Konsolenausgaben herausfinden können, wie ich die Texture laden muss? Also unter welchem Namen?
Frage 3: Warum muss ich hier die Texturen nicht mehr mit object3d.setTexture() anhängen

Dann will ich einen zweiten Baum laden. Dieser liegt im MD2-Format vor. Diesen lade ich mit Loader.loadMD2(); Hier gibt es keine entsprechenden Konsolenausgaben, auch hier liegen wieder BMP und TGA als Textur dem Model bei. Ich schaffe es aber nicht, auf die gleiche Weise die Texture auf das Objekt zu bringen...

Danke für die Unterstützung!

3
German corner / Re: AWTGLRenderer
« on: May 09, 2011, 04:02:35 pm »
Nach längerer Pause möchte ich wieder an meinem JPCT-Projekt weiterarbeiten.
Ich habe mir das mit den verschiedenen Renderern nochmal angesehen und bin jetzt leider etwas verwirrt...

Ich möchte auf jeden Fall Hardware-Rendering machen, verstehe aber nicht genau, was der Unterschied zwischen den beiden Hardware-Renderern (native/awt) ist...
Gibt es irgendwo ein Beispiel, wo die komplette Initialisierung mit mouse- und keyboard-Abfragen mit dem native renderer gemacht sind?

Danke!
Stefan

4
German corner / Re: AWTGLRenderer
« on: January 23, 2011, 04:21:33 am »
Weiß nur noch nicht sorecht, wie ich das HUD machen soll, und hatte da schon Swing im Sinn....

5
German corner / Re: Car-Example
« on: January 23, 2011, 04:20:52 am »
Ah ok, alles klar!
Danke!

6
German corner / AWTGLRenderer
« on: January 22, 2011, 04:57:28 pm »
Und gleich noch eine Frage :)

Über den AWTGLRenderer hab ich ganz wenig Infos gefunden, allerdings glaube ich, dass ich ihn in meinem Projekt brauche.
Hier steht, dass ich damit AWT und Swing benutzen kann: http://www.jpct.net/wiki/index.php/The_different_renderers
Auch beispielsweise die AWT Mouse- und KeyListener?

Hier steht, dass der OpenGL-Renderer sein eigenes Fenster mitbringt:
http://www.java-forum.org/spiele-multimedia-programmierung/68739-2-fenster-jpct.html
Ist das beim AWTGLRenderer auch so, oder muss ich den AWT Frame selbst erzeugen und benutze dann bei frameBuffer.display() das Graphics von meinem Frame.

Und wie initialisiert man den AWTGLRenderer?
In der JavaDoc hab ich im FrameBuffer die Methode enableGLCanvasRenderer() gefunden. Muss ich die zusammen mit enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL) benutzen oder nur die erste Methode?
Wenn ich nur die erste Methode benutze, dann sehe ich nur ein leeres Frame....

In diesem Thread lese ich, dass man enableGLCanvasRenderer() auch mit Parameter aufrufen kann:
http://www.jpct.net/forum2/index.php/topic,282.0.html
Aber das geht wohl nicht mehr?

Würdest Du mir prinzipiell zu AWTGLRenderer raten, oder handle ich mir damit Nachteile ein?


7
German corner / Car-Example
« on: January 22, 2011, 03:50:46 am »
Hi,

ich hab auf Basis des Car-Examples ein Spiel geschrieben und wollte nun eine Änderung vornehmen. Und zwar, dass das Spiel sofort mit Hardware-Rendering startet und nicht wie im Original mit Software-Rendering...
Dafür sind jetzt so wie ich das im Beispiel sehe, einige Dinge zu tun bzw. umzustellen.

Ich entnehme der Methode switchOptions() was ich im Rest des Codes ändern muss:

Code: [Select]
    /**
     * This is for switching settings. Currently, only switching from OpenGL to software and
     * back is supported here. This is done to avoid switching modes while polling the keyboard,
     * because it may have undesired side-effects otherwise.
     */
    private void switchOptions() {
        switch (switchMode) {
            case (SWITCH_RENDERER): {
                isIdle = true;
                if (buffer.usesRenderer(IRenderer.RENDERER_OPENGL)) {
                    keyMapper.destroy();
                    buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
                    buffer.enableRenderer(IRenderer.RENDERER_SOFTWARE, IRenderer.MODE_OPENGL);
                    openGL = false;
                    if (fullscreen) {
                        device.setFullScreenWindow(null);
                    }
                    frame.hide();
                    frame.dispose();
                    initializeFrame();
                } else {
                    frame.hide();
                    buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);
                    buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
                    openGL = true;
                    keyMapper.destroy();
                    keyMapper = new KeyMapper();
                }
                isIdle = false;
                break;
            }
        }
        switchMode = 0;
    }

Als erstes stelle in den Renderer um. An dieser Stelle frage ich mich schon, warum im einen Fall erst disabled und dann enabled wird, im anderen Fall andersherum? Gibts dafür einen bestimmten Grund?

Danach setzte ich den Default-Wert von "private boolean openGL" auf true.

Jetzt startet das Programm mit Hardware-Rendering. Allerdings ist ein zweites Fenster sichtbar. Nur, wenn das aktiv ist, registriert das Programm Tastendrücke. Das umzustellen ist mir nicht gelungen. Wahrscheinlich auch schon deshalb, weil ich "keyMapper.destroy();" nicht verstehe...

Über etwas Licht ins Dunkel würde ich mich seehr freuen.

Vielen Dank!
shadow

8
German corner / Unterschied zwischen SimpleVector normalize() und add()
« on: November 26, 2010, 11:53:00 am »
Hallo,

eine Frage bzw. Verständnisproblem:

SimpleVector.normalize() wirkt nicht auf das SimpleVector-Objekt selbst, sondern gibt den modifizierten Vector zurück.
Allerdings SimpleVector.add() gibt void zurück, wirkt also vermutlich direkt auf das SimpleVector-Objekt.

Ist das so richtig? Gibt es einen Grund warum das so ist? Ich finde, es gibt durchaus Anwendungsfälle, wo man es umgekehrt haben möchte, also dass normalize() auf das Objekt wirkt, oder add() nur zurückgegeben wird. Am coolsten wäre natürlich beides:

SimpleVector normalize();
void normalizeThis();

SimpleVector add(SimpleVector vec);
void addToThis(SimpleVector vec);


MfG!
Stefan

9
Bones / Re: Bones - Skeletal and Pose animations for jPCT
« on: October 30, 2010, 04:43:36 pm »
Hey guys! I got it running!
Thank you so very very much for your help!!

Problem was, that I used envelope bones and the exporter wasn't able to convert them to Ogre MESH Xml. Now I  made the same thing with Blenders "Weight Painting" and then the bone weights seem to be exported!

If someone is interested, I did my experiments today with a sample model which I uploaded to this archive:
http://iluzio.de/models2.zip

One thing is still a bit mysterious though, as you can see in the following image. I have arms, legs and head bones but they aren't rendered in the Sample app. But the torso and hip bones are rendered. There must be some difference between them...


10
Support / Re: Blender animation
« on: October 30, 2010, 04:35:37 pm »
I work with Blender 2.49b,
and I finally got my textured animated model running with Ogre MESH export and JPCT Bones! So this seems to be the best solution for me!

The collada exception I get:

Code: [Select]
30.10.2010 16:28:35 com.ardor3d.extension.model.collada.jdom.ColladaMeshUtils buildMesh
WARNUNG: No valid child found, creating 'cloud of points'
Exception in thread "main" java.lang.RuntimeException: Unable to load collada resource from URL: URLResourceSource [url=file:/home/floyd/projects/AntAttackJPCT/data/models/jessica_test2.dae, type=.dae]
        at com.ardor3d.extension.model.collada.jdom.ColladaImporter.load(ColladaImporter.java:154)
        at com.ardor3d.extension.model.collada.jdom.ColladaImporter.load(ColladaImporter.java:91)
        at bones.samples.ColladaSample.createAnimatedGroup(ColladaSample.java:55)
        at bones.samples.AbstractSkinSample.initialize(AbstractSkinSample.java:75)
        at bones.samples.ColladaSample.initialize(ColladaSample.java:75)
        at bones.samples.AbstractSample.loop(AbstractSample.java:85)
        at bones.samples.ColladaSample.main(ColladaSample.java:85)
Caused by: java.lang.NullPointerException
        at com.ardor3d.extension.animation.skeletal.SkeletonPose.<init>(SkeletonPose.java:47)
        at com.ardor3d.extension.model.collada.jdom.ColladaAnimUtils.buildSkinMeshes(ColladaAnimUtils.java:300)
        at com.ardor3d.extension.model.collada.jdom.ColladaAnimUtils.buildController(ColladaAnimUtils.java:157)
        at com.ardor3d.extension.model.collada.jdom.ColladaNodeUtils.getVisualScene(ColladaNodeUtils.java:115)
        at com.ardor3d.extension.model.collada.jdom.ColladaImporter.load(ColladaImporter.java:134)
        ... 6 more
Java Result: 1


MD2 would be cool though, especially on slow machines or mobiles. I'm so fixed to Blender because I want to use open source software and I'm able to use it now, which was a long way :) ... and so its a pity that the MD2 exporter isn't working properly :/

The 3DS keyframe thing is cool, if the other things don't work.


11
Support / Blender animation
« on: October 30, 2010, 03:09:04 am »
I've searched a lot of forum threads now and decided to open this topic to ask it directly:

What are my possiblities to get a textured and animated blender model in JPCT, best with minimal effort?
Actually I do not get it running at all... but I see three ways and try to find out which one is working and which one could be the best and and maybe there are even more ways?

* In another thread I try to get it running with "Bones", skeletal animation for JPCT. There are two "sub possibilities" I see
   - Ogre MESH format, but there seems to be a bug in the Blender Ogre exporter
   - Collada, there I got Exceptions with my own exported blender model while using the ColladaSample from the bones  samples

* MD2 Keyframe animation. Here there is "JPCT advanced example", where a snork runs around, looks good. Can such an MD2 file created with blender? If yes, is there any further information how this can be done?

* Keyframe animation via JPCT Animation as it is described here http://www.jpct.net/wiki/index.php/Loading_3ds_Keyframes_from_Blender
   - this seems to be a stable option, but in my opinion it is a bit complicated. Or am I too demanding?

12
Bones / Re: Bones - Skeletal and Pose animations for jPCT
« on: October 30, 2010, 02:35:03 am »
Yes, eeemm.... I forgot to add the right texture to the zip archive, but here I have it and it looks alright!

Thank you very much (!!) for figuring this out, but I really must say, I don't have any clue whats going on here...
With removing (or commenting) the autoAdjustCamera(); the skeleton is visible, and it is animated too! Thats cool so far...

But overriding the update() method it seems to me a lot of animation code is ommited. Why is the model rendered now because of this? And how did you find this out so fast :) ??


/EDIT:
If we could identify whats wrong with the export, maybe the ogre mesh script author could adjust his work....  May be an option.

13
Bones / Re: Bones - Skeletal and Pose animations for jPCT
« on: October 29, 2010, 08:10:02 pm »
@raft

Heres a screenshot of my problem:



Unfortunately I see nothing at all, I tried to zoom in and out and rotate, nothing appears :(
BUT: My Animation (called "Action") is in the list. And also in my previous post you can see that the armature is recognized in the file
I do not have max, I definitely want to use Blender... now I updated to the latest exporter script.


@fireside

I applied scale and rotation data to object -> no effect :(
And my armature has only one root...
I'm not sure if it has something to do with the materials because I neither see polygons nor armature. But anyway what does this mean "the material is right in the material file" ?


Thanks for your support but so far I did not get it running. Maybe it helps if you see my files? I created an archive with blender and OGRE mesh files...
http://iluzio.de/models.zip


And another question:
If this does not work, I do not have to use bone animation, although it would be very cool. Do you know an easy way to get my animated models from Blender into JPCT?

14
Bones / Re: Bones - Skeletal and Pose animations for jPCT
« on: October 26, 2010, 10:47:59 pm »
Hi,

I try to use Bones for the first time and all the examples work alright! Now I'm trying to get my own model running...
I created a figure in Blender, made some very simple animation with it and explorted it to an Ogre Mesh. Then I modified the OgreSample.java from the samples to load my own model. The frame opens but I cannot see my model at all. Do you have an idea why? Can it have something to do with the "Rotation axis not normalized" warnings? This is the console output:

Code: [Select]
Java version is: 1.6.0_21
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
26.10.2010 22:33:28 com.jme.scene.Node <init>
INFO: Node created.
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jmex.model.ogrexml.anim.SkeletonLoader loadSkeleton
WARNUNG: Rotation axis not normalized
26.10.2010 22:33:28 com.jme.scene.Node attachChild
INFO: Child "CubeMesh000" attached to this node "Cube"
-- total 17 joint(s) --
0 name: Bone, parent:
1 name: Bone.001, parent: 0:Bone
2 name: Bone.004, parent: 0:Bone
3 name: Bone.007, parent: 0:Bone
4 name: Bone.011, parent: 3:Bone.007
5 name: Bone.014, parent: 3:Bone.007
6 name: Bone.008, parent: 3:Bone.007
7 name: Bone.002, parent: 1:Bone.001
8 name: Bone.005, parent: 2:Bone.004
9 name: Bone.006, parent: 8:Bone.005
10 name: Bone.009, parent: 6:Bone.008
11 name: Bone.012, parent: 4:Bone.011
12 name: Bone.003, parent: 7:Bone.002
13 name: Bone.010, parent: 10:Bone.009
14 name: Bone.016, parent: 9:Bone.006
15 name: Bone.013, parent: 11:Bone.012
16 name: Bone.015, parent: 12:Bone.003
-- --
Skeleton created out of jME OGRE skeleton, 17 joints
Created skeleton animation clip: Action
Loading Texture..../data/models/jessica.png

Thanks very much in advance!
Stefan

Pages: [1]