Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: PienueDut

26. May 2012, 09:05:29 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Question about texture and models
Pages: [1] 2
Print
Author Topic: Question about texture and models  (Read 2787 times)
Boerboon
Just dropped in

Offline Offline

Posts: 13


View Profile Email
« on: 01. February 2007, 11:35:44 pm »

Hello...

I have just started using Xith and I was wondering if some one could help me...

I am trying to import a .obj model (Wavefront object) which I exported from Blender.
I have no problems getting the model to display, the problem is that it doesn't have any
of it's textures that where loaded in Blender. The model just displays in black.
I am doing some thing wrong when exporting from Blender or when I pull the model into the program?

My code is as follows

Code:

import org.xith3d.loaders.models.impl.obj.OBJLoader;
import org.xith3d.loaders.models.impl.obj.OBJModel;
import org.xith3d.render.base.Xith3DEnvironment;
import org.xith3d.render.canvas.Canvas3DWrapper;
import org.xith3d.render.canvas.Canvas3DWrapper.Resolution;
import org.xith3d.render.loop.RenderLoop;
import org.xith3d.scenegraph.Node;
import org.xith3d.scenegraph.Transform3D;
import org.xith3d.scenegraph.TransformGroup;
import org.xith3d.utility.interpolate.AngleInterpolater;

public class LearningXithModel extends RenderLoop{

private Transform3D t3d;
private TransformGroup tg;
private AngleInterpolater angleX;
private AngleInterpolater angleY;

private Node createScene() throws Exception{

OBJModel model;

model = new OBJLoader().loadModel("test.obj");


t3d = new Transform3D();
tg = new TransformGroup( t3d );
   
tg.addChild( model );


return(tg);
}

protected void onRenderLoopStarted(){

angleX = new AngleInterpolater(0.0f, 1.0f,
0.0f, (float)Math.PI * 2.0f, true );
angleY = new AngleInterpolater(0.0f, 1.0f,
        0.0f, (float)Math.PI * 2.0f, true );

angleX.startIncreasing(this.getGameTime());
angleY.startIncreasing(this.getGameTime());

}

protected void loopIteration(long gameTime, long frameRate){

t3d.rotXYZ(angleX.getValue(gameTime),
   angleY.getValue(gameTime), 0.0f);

tg.setTransform(t3d);

super.loopIteration(gameTime, frameRate);
}

public LearningXithModel() throws Exception{

super( 128L );
   
Xith3DEnvironment env = new Xith3DEnvironment( this );

Canvas3DWrapper canvas = Canvas3DWrapper.createStandalone(
                                              Resolution.RES_800X600,
                                             "My empty scene" );
     
env.addCanvas(canvas);
env.addChild(createScene());
     
this.begin();
}

public static void main(String[] args)throws Exception
{
    new LearningXithModel();
}

}

Thanks for any help.

Boerboon

P.S. Xith is great!!   Grin
Logged
Boerboon
Just dropped in

Offline Offline

Posts: 13


View Profile Email
« Reply #1 on: 01. February 2007, 11:43:38 pm »

Oh just found tutorial on the forum about Blender and Xith... I will give that a read and see if solves my problem! Smiley
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #2 on: 01. February 2007, 11:57:07 pm »

Hi, Boerboon

Welcome to Xith3D Smiley.

Good to see, that you found the tutorial yourself.

Have fun with Xith3D. Please ask, if you have further questions.

Just a question of personal interest: How did you come to Xith3D?

Marvin
Logged
Boerboon
Just dropped in

Offline Offline

Posts: 13


View Profile Email
« Reply #3 on: 02. February 2007, 12:32:13 am »

Hi Marvin,

Thanks for the Welcome...
I got the model to import with textures which I am thrilled about.

Currently I am working on University project which requires 3D graphics and my research into Java3D lead me here. I can't remember what website lead me here but I am very glad that I found Xith3D cause it looks great.   Grin

I am working group project to create 3D maze game so I am bound to have some more questions.

I was wondering if you point me to some more tutorials...? Smiley

Thanks again!

Boerboon
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #4 on: 02. February 2007, 12:07:28 pm »

I am working group project to create 3D maze game so I am bound to have some more questions.


Don't hasitate Smiley

I was wondering if you point me to some more tutorials...? Smiley

Well, do you know "Xith3D in a Nutshell" (XIN)? Or do you know the test classes in org.xith3d.test?

Do you use the SVN trunk version or the beta1?

Marvin
Logged
Boerboon
Just dropped in

Offline Offline

Posts: 13


View Profile Email
« Reply #5 on: 02. February 2007, 02:47:38 pm »

We are using the beta1 version.

I have been through the Xith3D in Nutshell, found it very useful.
I haven't looked at org.xith3d.test yet, I will give them a run down tonight.

Thanks for the suggestion!

Boerboon


Logged
'n ddrylliog
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #6 on: 02. February 2007, 04:10:13 pm »

Boerboon, what kind of tutorials do you want ? (Note : I have done/started several tutos, so just ask and I'll try to make things as clear as possible*)

* but not clearer, Einstein would add  Wink
Logged
Boerboon
Just dropped in

Offline Offline

Posts: 13


View Profile Email
« Reply #7 on: 02. February 2007, 09:27:30 pm »

Hi, any thing about nodes, branchgroups and such like would be great! Grin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #8 on: 02. February 2007, 09:40:32 pm »

Hi, any thing about nodes, branchgroups and such like would be great! Grin

I have an unfinished tutorial about a SceneGraph in Xith3D here, that I made for a friend. I will finish it and upload here.

Marvin
Logged
Boerboon
Just dropped in

Offline Offline

Posts: 13


View Profile Email
« Reply #9 on: 02. February 2007, 11:00:17 pm »


I have an unfinished tutorial about a SceneGraph in Xith3D here, that I made for a friend. I will finish it and upload here.

Thank you that would be great! My whole team could do with the tutorial! Grin

Boerboon
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #10 on: 03. February 2007, 12:47:14 am »

Here is the SceneGraph tutorial. I'm not very happy with it and it is not totally complete. But it is a first throw. Please tell me, if anything is not clear in it, or if there's anything missing.

Marvin
Logged
'n ddrylliog
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #11 on: 03. February 2007, 10:32:46 am »

if there's anything missing.
Code snippets, and a demonstrative example in org.xith3d.w3g (e.g.)
Besides, great work ! (I love OpenOffice.org default shapes Smiley )
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #12 on: 03. February 2007, 01:03:16 pm »

Code snippets, and a demonstrative example in org.xith3d.w3g (e.g.)

OK. I will see, what I can do.

Besides, great work ! (I love OpenOffice.org default shapes Smiley )

Thanks.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #13 on: 03. February 2007, 04:32:00 pm »

Code snippets, and a demonstrative example in org.xith3d.w3g (e.g.)

I have extended the tutorial to describe the SceneGraph interface and Xith3DEnvironment as well and added appropriate code snippets.

Marvin
Logged
Boerboon
Just dropped in

Offline Offline

Posts: 13


View Profile Email
« Reply #14 on: 04. February 2007, 02:29:01 pm »

Hello Marvin,

Thank you very much for the tutorial, it really helped me in understanding Xith and SceneGraphs.
Would it be ok for me to print it and give it to the rest of my group?

Again thank you for the tutorial.

Many thanks

Boerboon
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic