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.

DarkBASIC Professional Discussion / DBPro [rc7.7 latest] Mapping Separate Textures to Each Face of a Cube

Author
Message
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 20th Mar 2013 18:31
I have been struggling with this for quite some time. I thought that I could do it in another program (Blender, 3DS Max) and import them into DBPro.

Not only do I not get the textures and colors, I only get the primitive cube in gray. Is there a way to create the geometry in DBPro and map a texture to each face? Making 6-sided dice for a board game or a random roll generator to drop dice into the box, bound off a few baffles, and pop out the bottom to be read.

It's been something I've been working on for a while now, as part of a minigame, but I didn't want to screw with Unity3D to build it since I can't place "skyboxes" and "cubemaps" on Unity3D's cubes.

Please help.

All trees have bark. All dogs bark. All dogs are trees.
paul5147
19
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot & Sunny
Posted: 20th Mar 2013 18:46 Edited at: 20th Mar 2013 20:14
Simple way to do it in DBpro is to make an object that represents the dice,a cube is the obvious choice and make it small than size of the dice you want,then make a plane object the size of the dice face,convert this to a mesh.Add the six faces of the dice one at a time by making limbs attached,rotated and positioned to the the original cube object from the mesh.Texture each limb with the image you want.Then delete the plane object and mesh.If you get stuck let me know and ill post up a demo for you later.
EDIT:

Uses Matrix1 plugin for the plains(personal preference)but you can change that to standard DBPro plains you will just have to change the rotation and offsets
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 20th Mar 2013 23:14
Another way is to mess around with the vertexdata commands to map 6 portions of one image onto each face.



Boo!
baxslash
Valued Member
Bronze Codemaster
18
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th Mar 2013 23:33
Wow, spooky didn't know you were still around great to see you!!!

Maybe I should frequent the DBPro forums more often


this.mess = abs(sin(times#))
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 21st Mar 2013 03:07
Thanks. I will look into these and see which will work for me. These two ideas look to render similar results, but I'm using a netbook while I'm away from home. (I can't play Eve Online with it either! >_<

Anyway, I'm coding some stuff with it to make a random dice rolling program and needed to see what I could do with the primitive cubes.

Thanks again! Will be checking these out.

All trees have bark. All dogs bark. All dogs are trees.
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 21st Mar 2013 04:15
@paul5147: it wouldn't work either way. It would compile perfectly, but I waited for about 10 minutes and nothing showed in the window it created. Thank you for your assistance. It is more daunting than I was anticipating, but thank you for offering your version.

@Spooky: this worked well for me, and I created a simple 'texture' to use in Paint.Net in about 10 minutes... LOL It runs very smoothly and it's easier to get my head around. I liked the texture-building FUNCTION you built for this. ^_^ It was something I had not thought about. Great stuff.

Now, on to the rest of the die roller.

Thanks again!

~Cheers

All trees have bark. All dogs bark. All dogs are trees.
paul5147
19
Years of Service
User Offline
Joined: 11th Jan 2006
Location: Hot &amp; Sunny
Posted: 21st Mar 2013 19:12
Hi Anitarquious I,thanks for trying my code,im a bit puzzled as to why it doesn't show any thing as i used that code on a dice game i was going to release on the appup store ,and i remember testing it on the wifes netbook without problems.
What screen resolution does your netbook have?
The reason i gave for using six limbs as opposed to the vertex method,which i would normally use myself for anything other than a dice games,is it makes it incredibly easy to find out which sides actually pointing up. Basically which ever limbs got the highest y position is on top.
Good look with the rest of the game,hope to see a wip post on it soon.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 21st Mar 2013 22:52
Glad to be of help.

@baxslash - Yeah, still pop into this forum every night for a quick read although I haven't coded anything for years due to lack of time and real life getting in the way! However I'm in a new job now and have much more free time to get back into coding. So will get around to finishing the game I started writing 8 years ago for the 2005 TGC puzzle game compo!

Boo!
WickedVixen
18
Years of Service
User Offline
Joined: 28th Mar 2007
Location: New Brisbane, Utopia Prime, VGC GHQ
Posted: 22nd Mar 2013 05:02
@paul5147: the netbook resolution is 1024x600. It works, but the planes are sticking out of a super-tiny cube(?) and they're not at all in the proper places. Even adjusting the rotations and such, I muddled through it (using DBPro's PLANEs), and I still couldn't get it working... >_< I think I'm just confused, is all. Been a long couple of nights, too... lol

Thanks again.

All trees have bark. All dogs bark. All dogs are trees.

Login to post a reply

Server time is: 2025-05-17 13:31:06
Your offset time is: 2025-05-17 13:31:06