Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Apr 30, 2024 6:27 pm

All times are UTC




Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Fri Oct 07, 2005 11:09 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Looks great !

You're using texture mapping in this example, it explains why it's blue (there's probably a blue texture sets, and you prepare this texture at the top of your function).

Instead of :
Code:
raydium_rendering_internal_prepare_texture_render(raydium_texture_current_main);
raydium_rendering_internal_restore_render_state() ;
glColor4fv(raydium_background_color);


You should simply try:
Code:
glDisable(GL_TEXTURE_2D);
// all your rendering code
glEnable(GL_TEXTURE_2D);


There also a problem with:
Code:
GLfloat p[detail+1][detail+1][3];

It's not C code :) Only C++ allows this, since it's not "static". GCC is too friendly, sometimes ;)
We must replace this by malloc()/free() or linear index. I can do it if you want. You can also use something like [DETAIL_MAX][DETAIL_MAX][3] if you're lazy as I am ;)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 10:04 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Ok, done. Now it works fine.

I have added a few functions, to give it coherency, and the explanations in the .h file with the new title about "atmosphere".
Also i have added a flag that prevents for recalculating the vertices of the sphere in each frame.
In the last minute i have added a blend function and i have make that camera_internal draws (when atmosphere is active) also the skybox, you can see the efect is interesting.
The idea is to have 2 or more clouds spheres rotating and blending each others, in that way we could see like dinamyc clouds.

Next, i have to make the support for different colors in the gradient.
Btw, where did you found the model of the car? Or you did it yourself? I'm searching for goods models like vipers, ferraris, etc...

Hmmm, i'm trying to make an upload of the diferent files but i can't upload the whole with my program(rapidsvn) in just a commit(i should do as commits as levels of folders).
What svn program are you using?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 10:31 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
The clio model is a Need For Speed (3 ou 4, can't remember) custom car. Import was done with zmodeler -> DirectX file -> directx2tri.php. This was initialy intended to be a simple test, and this car is now our main model :) Apologies to its author, we never ask him :/

I'm using "official" command line svn client. I haven't understand the problem with "directory level" commit .. ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 11:09 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Explaining the problem i have solved it.
Files uploaded.
Hmmm,Is hard to extract one of that cars? Could you extract one(viper or similar) for me? :roll: :roll: I don't have the game either the tools...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 11:17 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
hmmm, detected bug with the blending function of the logo... i'll try fix it.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 11:18 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Good, i'll check your commit :)

About car imports, see:
http://www.nfscars.net/ (for example, there's many more)
http://www.zmodeler2.com/

There's all you need :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 11:33 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
- What's "int tot=0;" in trigo.c ? angle1 ? angle2 ? (in sky.c)
- Where's the typedef for matrix4x4 ?
The define of SPHERE_DEFAULT_DETAIL is not at the right place (too late for camera.c)
- ...

Please, please, commit only when code is compilable !

Also, take care of names :
SPHERE_DEFAULT_DETAIL should be named RAYDIUM_SKY_SPHERE_DETAIL_DEFAULT (or something like that), all global variables (and defines) must be declared and correctly named in common.h (dynamic linking will fail otherwise), and I think "raydium_atmosphere_*" must be renamed "raydium_sky_atmosphere_*".

Again, it's important to keep repository compilable, since there's many "non-programmers" who updates often.
I let you correct all this ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 11:45 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
¿¿:shock: ??? is not compilable???
Hm, i don't understand, that compiles for me perfeclty...
wait, i'll check again

update:
wops, you are right. The trigo.c file should be upload, i'm still debuggin it (i forgot).
Fixing...


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 11:49 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Use "make" (see compile.log), and then ./odyncomp.sh (not ocomp.sh), that's probably the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 12:14 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
yes, thas was the problem, i was using ocomp and i though that it compiled.
Fixed anyway, you can check it already. And this time it compiles 8)
I have fixed also the blending error with the logo .
int tot has been moved into his funciont.
angle1 and angle2 has been renamed as angle_orbit_u and angle_orbit_v, more descriptives.
SPHERE_DEFAULT_DETAIL has been renamed to RAYDIUM_SPHERE_DEFAULT_DETAIL and has been put in common.h, also with RAYDIUM_SPHERE_MAX_DETAIL.

In the next commit i'll rename atmosphere functions.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 12:29 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Good ! I don't have time to check all this now, I'll do it this evening, I think :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 2:58 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Xfennec wrote:
Good, i'll check your commit :)

About car imports, see:
http://www.nfscars.net/ (for example, there's many more)
http://www.zmodeler2.com/

There's all you need :)

The tools are for win32... i have linux
There are no linux version of the tools?
The models are great :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 08, 2005 5:55 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
i have commit the rename of the functions atmosphere.
I don't know whic is the rule with the const variables of a file. should go into common.h?or i let them in the sky.c file?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 09, 2005 12:46 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
See http://raydium.cqfd-corp.org/svn.php , at revision 91.
I've changed:

- removed matrix4x4 typdef from headers/trigo.h and moved it to common.h. headers must only declare function and provide documentation. I've also cut doc sentences to 80 characters long max.

- in headers/sky.c, i've done the same thing (80 char max) and (this is important) changed raydium_sky_atmosphere_check()'s return from "char" to "signed char". Python bindings are VERY sensitive to this ("char" really means "character" for Python, and not "8 bit value" as C does).

- in camera.c, there was a huge problem with tabs :)

- in common.h, I've changed RAYDIUM_SPHERE_MAX_DETAIL to RAYDIUM_SKY_SPHERE_MAX_DETAIL (since it was unclear to what sphere it was referring) and the same for RAYDIUM_SPHERE_DEFAULT_DETAIL. As said above, I've added (and modified a bit) matrix4x4 typdef, and also moved all sky.c globals, with a more "exact" name (raydium_sky_atmosphere_enable_tag; raydium_sky_sphere_angle_orbit_u; raydium_sky_sphere_angle_orbit_v;raydium_sky_sphere_generated;).

- in sky.c, I've changed all variables according to new variable names, disabled "glPushAttrib/glPopAttrib" but restored correct "glBlendFunc" at the end of function (caution with that ! It may generate big bugs !). I've also changed orbit increments to be FPS independent (using raydium_frame_time factor).

-------
What must be done now:

- Check that "detail" is in bounds (using RAYDIUM_SKY_SPHERE_MAX_DETAIL) in sky.c

- Allow user to modify "orbit" values and increment with suitable function.

- Be more careful about tab size

- Never create function without "raydium_..." prefix, since it may collide with user functions. All trigo.c matrix4x4 internals MUST be renamed.

... But the effect looks good for a beginning ! Let's continue on that way ;)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 09, 2005 11:55 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
ok (there are a lot of new manners for me, but i try to use myself to them)
The kind of tab i'm using is the default in anjuta...(except i like to pan the {} in a loop to be align with the sentence of the loop).
Which IDE are you using? or just an text editor?

What's the problem with glPush/PopAttirib?

Ideas about how to specify if the sky will use a spherical texture or a gradient?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 94 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group