Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Textures on primitives problems (DBPro)

Author
Message
Hammaman
20
Years of Service
User Offline
Joined: 11th Feb 2004
Location:
Posted: 15th Mar 2007 14:51
Hi,

I'm working on a maze game whereby the maze is made up of a grid of 64x64 squares, and each grid can be a wall, door, or empty.

I've followed the approach of one of the DBPro tutorials which involved creating a cube at each point of the grid where there is a wall - but clearly, the number of cubes on screen at one time can be large and so the program crawls along.

To solve this, I've created a function to analyse the map and create a box of the required size to replace cubes on successive grid points, i.e. if a wall runs from 1,3 to 10,3, then instead of creating a cube at 1,3, then another at 2,3, and so on until 10,3, I create a box at 1,3 with length 10 and width 1 (and height 1).

However, when I try to apply a texture to the box, the texture is stretched on one side, but OK on the other; and if I scale the texture, then this sorts out the problem on one side, but then creates a problem on the other.

So is there a way to control textures better for the inbuilt primitive objects? Or is there another way to achieve this flexibility of being able to create walls dynamically in the code, and to be able to texture the sides separately?

Any help appreciated - I can post screenshots/code if this would help.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Mar 2007 16:53
It would be better to use plains. Then you have 2 polys per wall section. With a cube, you potentially have 10 wasted polys per wall. You can also control the texture better too.
Hammaman
20
Years of Service
User Offline
Joined: 11th Feb 2004
Location:
Posted: 15th Mar 2007 19:15
Thanks BatVink! Do I need to join the plains together or just position them next to each other (I seem to recall an issue where I could see through a join depending on the camera angle, but this was probably a non-based DBP project ...)?

Login to post a reply

Server time is: 2024-09-25 19:21:46
Your offset time is: 2024-09-25 19:21:46