Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11855 Posts in 1569 Topics- by 3045 Members - Latest Member: lensreslai

10. February 2012, 04:55:47 AM
Xith3D CommunityProjectsYour Projects (Moderator: 'n ddrylliog)Sonic the Hedgehog 3D Fangame (old topic)
Pages: 1 [2] 3 4 5
Print
Author Topic: Sonic the Hedgehog 3D Fangame (old topic)  (Read 17659 times)
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #15 on: 21. August 2007, 09:46:27 AM »

Static models are loaded okay, as long as they're "triangles", not "polygons".

Can you recognize, if they are quads? In this case you could do a quick on-the-fly triangulization in the loader.

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

Posts: 1188



View Profile WWW Email
« Reply #16 on: 21. August 2007, 12:31:23 PM »

Static models are loaded okay, as long as they're "triangles", not "polygons".
Can you recognize, if they are quads? In this case you could do a quick on-the-fly triangulization in the loader.
Hehe Smiley The only way to recognize that would be to check that all the polys have 4 points.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #17 on: 21. August 2007, 06:37:52 PM »

Hehe Smiley The only way to recognize that would be to check that all the polys have 4 points.

Well, you know, how the COLLADA files are structured (I don't). IIRC in the OBJ files there are header information about the vertex count for each polygon. I just thought, the COLLADA files might contain such information, too.

Marvin
Logged
BrazilianBoy
Becoming dependent
**
Offline Offline

Posts: 208


l_p_camargo@hotmail.com
View Profile Email
« Reply #18 on: 21. August 2007, 08:45:24 PM »

Is there a way to encrypt resources(tex,models,etc) in some way?

What are the URL's to the repositories of xpal, joode, hial, and collada?
« Last Edit: 21. August 2007, 08:50:30 PM by BrazilianBoy » Logged

Getting my hands dirty Smiley
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #19 on: 21. August 2007, 08:55:48 PM »

Is there a way to encrypt resources(tex,models,etc) in some way?

Nothing integrated. Do you need this for serialization?

What are the URL's to the repositories of xpal, joode, hial, and collada?

Please have a look at http://xith.org/. In the right sidebar there are all links to dependencies. Well, there's not link for COLLADA (and it is not a link for this sidebar). Please wait for Amos for that link or use google Wink.

Marvin
Logged
BrazilianBoy
Becoming dependent
**
Offline Offline

Posts: 208


l_p_camargo@hotmail.com
View Profile Email
« Reply #20 on: 21. August 2007, 08:58:31 PM »

Do you need this for serialization?

I used to encrypt all the resources of my 2D games.
« Last Edit: 21. August 2007, 09:01:04 PM by BrazilianBoy » Logged

Getting my hands dirty Smiley
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #21 on: 21. August 2007, 09:21:47 PM »

I guess, you could simply use some kind of decryption input stream and use this to load the models. Principally this also works for textures, but I'm not sure, if stream loading is for public use (except for creating new TextureStreamLoaders for all of your image formats. But, if you need it, I can see, how easily it is possible to make it public.

Marvin
Logged
BrazilianBoy
Becoming dependent
**
Offline Offline

Posts: 208


l_p_camargo@hotmail.com
View Profile Email
« Reply #22 on: 21. August 2007, 09:28:04 PM »

When I do it with models, the TextureLoader can't find the model's textures.
Logged

Getting my hands dirty Smiley
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #23 on: 21. August 2007, 09:35:51 PM »

When I do it with models, the TextureLoader can't find the model's textures.

Set the BaseURL of the model loader:
Code:
Loader loader = new BlahLoader();
loader.setBaseURL( ... );
Model model = loader.loadMode( ... );

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

Posts: 1188



View Profile WWW Email
« Reply #24 on: 22. August 2007, 06:42:08 AM »

Hehe Smiley The only way to recognize that would be to check that all the polys have 4 points.
Well, you know, how the COLLADA files are structured (I don't). IIRC in the OBJ files there are header information about the vertex count for each polygon. I just thought, the COLLADA files might contain such information, too.
Yep, example with the "polylist" element :

Code:
<mesh>
  <source id="position" />
  <source id="normal" />
  <vertices id="verts">
    <input semantic="POSITION" source="#position"/>
  </vertices>
  <polylist count="3" material="#Bricks">
    <input semantic="VERTEX" source="#verts" offset="0" />
    <input semantic="NORMAL" source="#normal" offset="1" />
    <vcount>4 4 3</vcount>
    <p>0 0 2 1 3 2 1 3 4 4 6 5 7 6 5 7 8 8 10 9 9 10</p>
  </polylist>
</mesh>
Here we should just check that vcount contains only the number 4.

With the "polygons" element, however, it's a bit more complicated :
Code:
<mesh>
  <source id="position" />
  <source id="normal" />
  <vertices id="verts">
    <input semantic="POSITION" source="#position"/>
  </vertices>
  <polygons count="1" material="#Bricks">
    <input semantic="VERTEX" source="#verts" offset="0"/>
    <input semantic="NORMAL" source="#normal" offset="1"/>
    <p>0 0 2 1 3 2 1 3</p>
  </polygons>
</mesh>
Here we have to divide the number of values in each "p" element (which corresponds to one polygon) by the biggest offset + 1. Example here we have 8 values in a single "p" element. The biggest offset is 1. 8 / 2 = 4. So yes sir, it's a quad.

Is there a way to encrypt resources(tex,models,etc) in some way?
It would be a pleasure to integrate some encryption/decryption in Xith3D itself. Which algorithm were you using with your 2D games ? We could add it easily, I think.

What are the URL's to the repositories of xpal, joode, hial, and collada?
XPAL has parts both in Xith3D (abstract part) and JOODE (concrete part).
COLLADA Loader has code both in Jagatoo (abstract part) and Xith3D (concrete part). The code provided by the COLLADA designers is of no use to us, because it's a C++ API, and we're Java devs. I had to build a Java API from the COLLADA spec with JiBX.
URL for JOODE : https://joode.svn.sourceforge.net/svnroot/joode joode
URL for HIAL : https://hial.svn.sourceforge.net/svnroot/hial hial
URL for JaGaToo : https://jagatoo.svn.sourceforge.net/svnroot/jagatoo jagatoo

Note that jagatoo and hial have built jars in the Xith3D repository, in the "third-party" directory.
Logged
BrazilianBoy
Becoming dependent
**
Offline Offline

Posts: 208


l_p_camargo@hotmail.com
View Profile Email
« Reply #25 on: 22. August 2007, 03:40:07 PM »

Is it possible to render-to-texture using xith?
I'd like to implement motion blur using a render pass.
Logged

Getting my hands dirty Smiley
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #26 on: 22. August 2007, 03:49:44 PM »

Is it possible to render-to-texture using xith?
I'd like to implement motion blur using a render pass.
Look here : http://xith.org/forum/index.php/topic,555.0.html

Is the remaining of your game working ?  Grin Okay, I shut up..
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #27 on: 22. August 2007, 04:27:11 PM »

Here we should just check that vcount contains only the number 4.

The don't have to be all 4. They just have to be 3 or 4 to either take it as is ot do an on-the-fly-triangulation of each single quad.

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

Posts: 1188



View Profile WWW Email
« Reply #28 on: 22. August 2007, 04:36:52 PM »

Here we should just check that vcount contains only the number 4.
The don't have to be all 4. They just have to be 3 or 4 to either take it as is ot do an on-the-fly-triangulation of each single quad.
Yep, but I'd like to implement that in a generic way. Don't we have a triangulator class somewhere ? (I remember we were talking about that).
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #29 on: 22. August 2007, 04:44:27 PM »

Yep, but I'd like to implement that in a generic way. Don't we have a triangulator class somewhere ? (I remember we were talking about that).

Well, we talked about it. But nobody (including myself) has written one or ported. We weren't sure, if we could simply port the one from Java3D because of license issues. And a really generic triangulator is a quite complicated thing and highly expensive.

Triangulating quads is very cheap and can be done on the fly. I would suggest to do on_the-fly triangulation for quads and use the future-triangulator for more complicated geoms.

Marvin
Logged
Pages: 1 [2] 3 4 5
Print
Jump to:  

Theme orange-lt created by panic