[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4505: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4507: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4508: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4509: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3706)
RabidHaMsTeR.Org • View topic - Newbie's guide to basic overlays

Newbie's guide to basic overlays

How to create a custom scene, and custom scenes people have created.

Moderators: rabidhamster, Rovastar

Newbie's guide to basic overlays

Postby HardcoreKiller » Fri Jan 23, 2004 3:59 pm

Ok..script kiddie question...

I am trying to center the R4 overlay and need help understanding coordinates in:
void render() {
gl.clear();
gl.aspect=0;
gl.gltranslate(0,0,-2.414);
gl.glcolor(1,1,1,1);
gl.glbegin(gl_quads);
gl.gltexcoord(0,1);
gl.glvertex(0.7,-0.7,0);
gl.gltexcoord(1,1);
gl.glvertex(1,-0.7,0);
gl.gltexcoord(1,0);
gl.glvertex(1,-1.0,0);
gl.gltexcoord(0,0);
gl.glvertex(0.7,-1.0,0);
gl.glend();

I also want to be able keep the R4 overlay centered at bottom, or even full left side. I also want to be able to display a corporate logo nice and big right over the top of the object (in this case Medusa). I will look at "Sketch.r4" to figure out how to put the corporate logo behind the object.

Any help would be greatly appreciated!

-Hardcore
HardcoreKiller
 
Posts: 29
Joined: Tue Nov 11, 2003 5:25 am
Location: Arizona, USA

Postby Rovastar » Fri Jan 23, 2004 9:15 pm

Seriously have alook at NeHe tutorial on openGL if you have access to a programming language. YOu should be able to work out from the descriptions there what you need.

BUt basically gl-quads setup a quad shape

the co-ordinates of the quadratic shape (4 sides)

in tex coord and the location for each in 3d space in the vertax command directly below the each texcord commnad.

vertax commands in teh form (x,y,z)
Rovastar
 
Posts: 423
Joined: Mon May 19, 2003 3:15 am
Location: Derby & London, England

Postby HardcoreKiller » Sat Jan 24, 2004 12:15 am

Rova,

I will read as you suggested. In the mean time, as you have the knowledge to creat, can you create a .r4 scene that has the big picture of R4 in the center of the visual, in front of the object? Please?

Thank you,

Hardcore
HardcoreKiller
 
Posts: 29
Joined: Tue Nov 11, 2003 5:25 am
Location: Arizona, USA

Postby Guest » Sat Jan 24, 2004 6:34 am

Ok...after review of NeHe (which is full of knowledge, but not extremely helpful if you aren't at least a script kiddie or know some GL)...

So I read and read...then guessed. I came up with the following to display an overlay with something like Corporate Logo, Text, club pics (or any other pic you want overlayed anywhere or size on the screen)...

First, you need to make 2 PNGs or JPGs with the same attributes as your full screen size (in this case FS is 640/480, so I made 2 PNGs that were 640/480). Center or display the logo or pic as you want it to show up at fullscreen. You'll need to make 2 copies for the "transparency <see /tex/r4_a.png and r4_c.png for some direction>. Save as YOURS_a.png and YOURS_c.png.


Second, open the R4 overlay (overlayr4.r4) and change 2 parts, and save it as "OverlayYOURS.r4":

VOID INIT to the following
void init() {
strcpy(gl.shader,"T0;BAa;");
strcpy(img.filename,"YOURS_?.png");

and

VOID RENDER to the following:
void render() {
gl.clear();
gl.aspect=0;
gl.gltranslate(0,0,-2.414);
gl.glcolor(1,1,1,1);
gl.glbegin(gl_quads);
gl.gltexcoord(0,1);
gl.glvertex(-1.0,1.0,0);
gl.gltexcoord(1,1);
gl.glvertex(1.0,1.0,0);
gl.gltexcoord(1,0);
gl.glvertex(1.0,-1.0,0);
gl.gltexcoord(0,0);
gl.glvertex(-1.0,-1.0,0);
gl.glend();

Now run your overlay and tweak accordingly. Hope this helps a little.

-Hardcore
Guest
 

Postby rabidhamster » Sat Jan 24, 2004 11:58 am

Hi. sorry - i haven't been at the PC the last day. What you've suggested is just fine. The only minor 'problem' is that R4 will only use textures that are 128,256,512,1024 or 2048 pixels wide and high. In the case of 640x480, R4 will resize the image to 1024x512, increasing loading times and decreasing picture quality.

And thats really the only thing - try and make your textures 1024x512 or similar and you'll find they're much sharper.

Also, just as a tip, to make the _a (alpha channel) i take the original image, convert it to greyscale, and adjust brightness and contrast so its white on black. I then do a gaussian blur, and adjust the contrast a bit again - and voila - you get that black faded edge oin stuff.

Hope that helps - its good to know its working out for you - i will try and do a tutorial at some point.

- Gordon
rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England

Postby HardcoreKiller » Sun Jan 25, 2004 10:53 pm

HardcoreKiller
 
Posts: 29
Joined: Tue Nov 11, 2003 5:25 am
Location: Arizona, USA


Return to R4 Custom Scenes

Who is online

Users browsing this forum: No registered users and 6 guests

cron