Archived

This topic is now archived and is closed to further replies.

Bruno

Textures and Objects

Recommended Posts

Hi I''m loading a texture, and putting it on the screen as a background with this code: t1=PR_LoadTexture("fundo.jpg"); PRGFX_PutTexture(0,0,t1,NORMAL); Then, i''m tyring to make a render on that texture, but i can''t. The object is loaded, and rotating, but is on the backside of the texture. If i use XRAY instead of NORMAL i can see the object moving on the back. Any ideias how do i render the object above the texture, and like this using the texture as a background? Thanks Bruno

Share this post


Link to post
Share on other sites

i think PRGFX_PutTexture works as an overlay. i will be on top of all objects, you can have a few layers of overlays though.

If you want to have this texture, use PR_AllocSprite to convert it to an entity. this one always face the front.

another way is to face the texture on a rectangle mesh.
set it to double side. load the pro and use it directly.



Share this post


Link to post
Share on other sites
Thanks Iram
I did what you told me, but i had no luck,i mean i don''t neither a compilation or a linking error, but when i execute computer ignores the entity that i created...
Here is the code, can you give me a hand?
thanks

PR_OBJECT *backg;
PR_ENTITY *backg_entity;

t1=PR_LoadTexture("fundo.jpg");
backg = PR_AllocSprite(t1);
if (backg == NULL)
PR_FatalError ("Cannot open data file", "Program");
PR_CenterObject (backg, &cenx, &ceny, &cenz);
backg_entity = PR_CreateEntity (backg, "BIGB");


in the render loop, i have the transform_entity and the render_entity!!


Share this post


Link to post
Share on other sites
On a previous program I was working with I tried the same thing to place a texture in the background. I found that it only worked with certain video cards. For example, it worked fine on my G400 but when my voodoo II ran the same program I got the results you are getting.

Gary

Share this post


Link to post
Share on other sites
Thanks Gary
I''m still with the same problem ( , but i''m going to try the program in another computer, just to check.., i''m almost giving up on this
Thanks
Bruno

Share this post


Link to post
Share on other sites
You could also just blit your backround image strait to the direct draw surface prior to rendering.

Or you could do what was done in Homeworld and just put a globe with inverted normals around the visable scene with the texture applied to it. This actualy creates a really neat effect of the background actually having distance and perspective.

Share this post


Link to post
Share on other sites