Skip to main content
GameDev.net gamedev.net
🔒 Locked

Texturing an object

Started by HarrisonPloeg Feb 22, 2007 at 11:41 PM 1 replies 850+ views
Original Post
HarrisonPloeg
HarrisonPloeg
How do you texture an object created by the D3DXCreateBox() function? D3DXCreateBox(gd3dDevice, 1.0f, 8.0f, 8.0f, &mesh, NULL); gd3dDevice->SetTexture(0, texture); mesh->DrawSubset(0); If I do that I only get one colour over the entire object. Is there any code that I've missed? [Edited by - HarrisonPloeg on February 23, 2007 3:00:14 AM]
Stevieboy
Stevieboy
Hi, the boxes etc which come form the shape drawing functions do't have any tu & tv (texture) coordinates, you could either just have different colour boxes or make a box in a moddeling program.
Cigguh
Cigguh
You can use CloneMeshFVF and use "D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1" as FVF.
Then lock vertex buffer of this mesh to access it's data. It's the principle but if you just need to use textured cube then Stevieboy's solution is much better and easier.
i make the game so i be ballin

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.