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 - D4NM4N

Pages: [1]
1
Support / Access to surfaces?
« on: February 11, 2011, 10:59:49 am »
If i export a mesh with 2 different surfaces (eg a cube with the ends textured with a different texture) how do i texture the separate bits?

2
Support / Re: .obj textures from Blender
« on: February 07, 2011, 08:53:22 pm »
I learned a great deal by watching the youtube vids on it:
http://www.youtube.com/watch?v=e5_2seDBQrw&feature=related
Not sure if this is the best one, but it is one of many.

3
Support / Re: Hello world without envmap?
« on: February 06, 2011, 11:54:03 pm »
Gotcha so the UVs are not set for any primitives correct?
I had a sneaky feeling it was something along those lines.

4
Support / Hello world without envmap?
« on: February 06, 2011, 11:01:20 pm »
I cannot seem to get settexture working without an environment map :S
Using the hello world example, if i turn off (comment out) the environment map line all i get is a grey cube.
Are there any examples anywhere of texturing?

5
Support / Re: .obj textures from Blender
« on: February 03, 2011, 08:59:03 pm »
Hi,
A)I believe you need to 'bake' some UV maps (if using procedural textures). There is a .py script for this, but it has been a while since i tried it.
B)If using image textures rather than the proc ones (which is what i use) then you need to also choose UV map input in materials, but then unwrap the model and also add the texture in the UV editor window. (you will know it is working if you choose texture view and it looks right).
Modelling and animating in blender is awesome, it is a shame the texture system is so fiddily. :/
There are loads of youtubes on this subject though.

6
Support / Re: Some object manipulation funcs needed.
« on: February 02, 2011, 11:56:53 pm »
Great, That may have cracked it... no idea what scalarMul means but it seems to be doing something promising. :D

Code: [Select]
   public void MoveEntity(float x, float y, float z)
    {
        SimpleVector dir;
        dir=this.getXAxis(); // ?=X,Y,Z
        dir.scalarMul(x);
        this.translate(dir);
        dir=this.getYAxis(); // ?=X,Y,Z
        dir.scalarMul(y);
        this.translate(dir);
        dir=this.getZAxis(); // ?=X,Y,Z
        dir.scalarMul(z);
        this.translate(dir);
    }
I wont know for sure until i put in the time to test it properly. The whole Xaxis rotation thing is taking some getting used to  :-\.  
(Is there any way to set the engine to use standard world orientation (+y = up, +Z=away)

Here are my others most -seem- to be working ok. :)
Code: [Select]

    //PositionEntity
    public void PositionEntity(float x, float y, float z) {PositionEntity(new SimpleVector(x, y, z));}
    public void PositionEntity(SimpleVector dest)
    {
        this.setOrigin(dest);
        this.clearTranslation();
        if (_camera3D != null)
        {
            _camera3D.setPosition(dest);
        }
        if (_light != null)
        {
            _light.setPosition(dest);
        }

    }

    //RotateEntity
    public void RotateEntity(float x, float y, float z) {RotateEntity(new SimpleVector(x,y,z);}
    public void RotateEntity(SimpleVector rotation)
    {
        //conversion to degrees?
         _object3D.clearRotation();
        _object3D.setRotationPivot(rotation);
    }

    //ScaleEntity
    public void ScaleEntity(float x, float y, float z){ScaleEntity(new SimpleVector(x, y, z));}
    public void ScaleEntity(SimpleVector size)
    {
        throw new NotImplementedException();
    }

    //TranslateEntity
    public void TranslateEntity(float x, float y, float z) {TranslateEntity(new SimpleVector(x, y, z) );}
    public void TranslateEntity(SimpleVector offset )
    {
        this.translate(offset);
    }

    public void TurnEntity(SimpleVector rotation) {TurnEntity(rotation.x, rotation.y, rotation.z);}
    public void TurnEntity(float x, float y, float z)
    {
        this.rotateX(x);
        this.rotateY(y);
        this.rotateZ(z);

        if (_camera3D != null)
        {
            SimpleVector rot = this.getRotationPivot();
            _camera3D.rotateCameraX(rot.x);
            _camera3D.rotateCameraY(rot.y);
            _camera3D.rotateCameraZ(rot.z);

        }
    }


7
Support / Re: Some object manipulation funcs needed.
« on: February 02, 2011, 10:56:42 pm »
Kind of, I think i have got position, rotate and turn nailed (needs more testing to confirm)
i am still working on moveentity though, Basically i want it to move in relation to its rotation.
For example:
if an object is pointing 'southeast' and has a right hand 'roll' of say 30' a left movement will send it 'northeast' and upwards.. etc...

(sorry about the compass bearings, but best thing i could think of :D)

If i can get this little extention working i will post them here in case anyone else finds them useful. I will also try and do something similar for cameras and lights (using a nullentity to guide/rotate them).
If i can do this then i should be able to convert my game logic quite easily.

8
Support / Re: Some object manipulation funcs needed.
« on: January 28, 2011, 10:56:13 pm »
Thanks for the help :)

Hope you feel better

9
Support / Re: Some object manipulation funcs needed.
« on: January 28, 2011, 09:39:12 pm »
Hmm thats a pity, I think i might need to convert it somehow (as well as the odd twist in X axis :)) but as i said maths is not my forte.

So, by object space you are referring to the objects own scaled coordinates?
ie; for a loaded object scaled by 2x a translation of 20 will actually move 40 in world coords? If it is indeed object coord system only, then i guess i will have to load all my models in the right scale. - no biggie.

I think i have sussed out a way of positioning translating and rotating (for position i set an empty new matrix which seems to clear the translation which is kind of what i want. I assume for rotateentity i just clear the rotation and re-rotate it to the specified values?)

My biggest problem i think is "moveentity". The other big grief issue is how to get the XYZ coords of an object in relation to 0,0,0. Get center is one way, but i need the actual model's axis.

10
Support / Some object manipulation funcs needed.
« on: January 27, 2011, 11:53:06 pm »
Hi,

I would be soo grateful if someone can help me out with this.


Being totally useless with maths (I have no idea how mat4 works) I want to write a small wrapper some manipulation commands for converting some code.

Basically the engine I was using was Blitz3D. (I use irrlicht a bit too, but I managed to make some funcs for that)
I have extended Object3D and wish to create the following:

Code: [Select]
PositionEntity(float x, float y, float z) //or vector
{
      //Sets the position of the object. (using world coords)
      // is setOrigin(new SimpleVextor(xyz)); what i want?
}

MoveEntity(float x, float y, float z) //or vector
{
      //moves the object in xyz from it's current position in relation to it's rotation.(using world coords)
}

TranslateEntity(float x, float y, float z) //or vector
{
      //Similar to moveentity but moves the object from its current position but using a 0,0,0 rotation.
      // does the existing translate do this?
}

TurnEntity(float x, float y, float z) //or vector
{
      //turns the object in xyz at it's current position in relation to it's current rotation. (using world coords)
      //At the moment i am using rotateX() which seems to be doing it, is this the best way?
}

RotateEntity(float x, float y, float z) //or vector
{
      //Sets the rotation of the object. (using world coords)
 
}



The other thing i cannot work out is why is the getXaxis() etc returning vectors? I was expecting to see a float. The other thing is the camera and lights seem to have setRotation and setPosition, but object3d does't :S

I think if i can get these 5 methods working i will be well on my way.

11
Support / How to parent lights and cameras?
« on: January 21, 2011, 09:48:48 pm »
As they are not 3D objects, and there seems to be no pivot (meshless) 3d object to manually position/orient it to per update, so how can i make a camera or light behave as any other 3d object?  

12
Support / Re: Noob: Cannot get OGL hello world to run :/
« on: January 18, 2011, 11:21:10 pm »
Tht explains a few things, I think i am after option 2 with an optional software mode.

Are there examples/tutorials that show the initialisation and exactly which jars i need to include for all of these 4 modes.
I have looked and googled but cannot find any tuts for jpct at all.

I am a fairly experienced C# and C++ programmer but Java is fairly new to me and although it is very similar to C# and i am picking up the syntactical differences, i am still trying to get my head around the whole package/namespace/include system that Java uses (it seems to be very different to c# in this respect)

-so you will have to forgive my idiot questions.  ;D

13
Support / Re: Noob: Cannot get OGL hello world to run :/
« on: January 17, 2011, 11:32:03 pm »
Ok thanks :)

While i am at it, is there any reason why the SW version of hello world uses a jframe and the OGL one doesn't?
Also are there any tutorials about for this?

edit: i just noticed this at the top of the log (did not see it before because it scrolled out):
[ Mon Jan 17 23:46:30 CET 2011 ] - ERROR: Using a native GL renderer isn't possible when using JOGL! Remove glfacade.jar from the classpath!

i removed that and now getting:
Code: [Select]
run:
Loading Texture...box.jpg
Java version is: 1.6.0_20
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/opengl/Display
        at com.threed.jpct.GLHelper.findMode(Unknown Source)
        at com.threed.jpct.GLHelper.findMode(Unknown Source)
        at com.threed.jpct.GLHelper.init(Unknown Source)
        at com.threed.jpct.GLRenderer.init(Unknown Source)
        at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
        at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
        at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
        at HelloWorldOGL.loop(HelloWorldOGL.java:40)
        at HelloWorldOGL.main(HelloWorldOGL.java:18)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.opengl.Display
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
        ... 9 more
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)

14
Support / Re: Noob: Cannot get OGL hello world to run :/
« on: January 17, 2011, 10:36:03 pm »
I am using the out of the box example doesn't line 3 do that?

Code: [Select]
   private void loop() throws Exception {
        buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_NORMAL);
        buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
        buffer.enableRenderer(IRenderer.RENDERER_OPENGL, IRenderer.MODE_OPENGL);
int a=1;
        while (a!=2) {
            box.rotateY(0.01f);
            buffer.clear(java.awt.Color.BLUE);
            world.renderScene(buffer);
            world.draw(buffer);
            buffer.update();
            buffer.displayGLOnly();
            Thread.sleep(10);
        }
        buffer.disableRenderer(IRenderer.RENDERER_OPENGL);
        buffer.dispose();
        System.exit(0);
    }

Here is my glxinfo:
Code: [Select]
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory,
    GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control,
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap
GLX version: 1.2
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_SGI_make_current_read,
    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
    GLX_EXT_texture_from_pixmap
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) 945GM GEM 20091221 2009Q4
OpenGL version string: 1.4 Mesa 7.7.1
OpenGL extensions:

Does Mesa mean that it is limited to software at the OS level? On my other machine it seems to work ok.

15
Support / Noob: Cannot get OGL hello world to run :/
« on: January 11, 2011, 11:56:16 pm »
Hi everyone, new here  ;D

I have been playing around with the examples but cannot seem to get the OGL versions working. (SW versions work ok)

I get a grey screen with:

"WARNING: displayGLOnly() shouldn't be called without OpenGL support being (solely) used"

in the output.

I am using Ubuntu and I have an intel card HWRendering yes and ogl v1.4 in glx info. Is this enough or is it 2.0+ only?

Pages: [1]