mrh_3d
Community Member

Posts: 26
|
 |
« on: June 28, 2008, 06:11:22 AM » |
|
hi friends i have problem with using texture in vb.net (tv3d sdk 6.5)
i use these codes to get my texture to my object
tvm = New MTV3D65.TVEngine mesh = New MTV3D65.TVMesh sen = New MTV3D65.TVScene tex = New MTV3D65.TVTextureFactory Dim aaa As Long
tvm.Init3DWindowed(pic.Handle.ToInt32) aaa = tex.LoadTexture("e:\1.jpg", "aaa")
mesh = sen.CreateMeshBuilder()
mesh.CreateTeapot() mesh.SetPosition(3, 0, 10) mesh.SetTexture(aaa)
but when i render ,teapot is white and it hasn't texture. what do i do ?
|
|
|
|
|
Logged
|
|
|
|
AriusEso
Customers
Community Member
    
Posts: 377
Esoteric
|
 |
« Reply #1 on: June 28, 2008, 06:15:52 AM » |
|
What does your debug log say?
|
|
|
|
|
Logged
|
|
|
|
ZaPPZion
Community Member

Posts: 341
|
 |
« Reply #2 on: June 28, 2008, 06:17:21 AM » |
|
I think it's not finding the texture. If it is, try this:
mesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_MANAGED)
I think you'll need some lights as well, but at least it will show the texture
|
|
|
|
« Last Edit: June 28, 2008, 06:26:01 AM by ZaPPZion »
|
Logged
|
|
|
|
|
SylvainTV
|
 |
« Reply #3 on: June 28, 2008, 08:54:47 AM » |
|
I'm not sure that Teapot has UV information actually. Try with a Sphere or a box maybe?
|
|
|
|
|
Logged
|
|
|
|
ZaPPZion
Community Member

Posts: 341
|
 |
« Reply #4 on: June 28, 2008, 10:08:40 AM » |
|
yea, a directX teapot has a UV map on it. The texture seems tiled like 4 times on default
|
|
|
|
« Last Edit: June 28, 2008, 12:27:28 PM by ZaPPZion »
|
Logged
|
|
|
|
|
SylvainTV
|
 |
« Reply #5 on: June 28, 2008, 10:37:36 AM » |
|
Sorry then  I didn't remember, thanks Zappzion
|
|
|
|
|
Logged
|
|
|
|
jviper
Community Member

Posts: 1366
Discipline in training
|
 |
« Reply #6 on: June 28, 2008, 12:35:36 PM » |
|
are you sure the teapot has UV map info? Every time I create a teapot, I have to calculate the UV.
|
|
|
|
|
Logged
|
JAbstract.....Don't just imagine, make it happen!
|
|
|
ZaPPZion
Community Member

Posts: 341
|
 |
« Reply #7 on: June 28, 2008, 01:04:09 PM » |
|
Oh, that's weird, i just created a teapot in 3dmax, and i opened one of my projects to try it. But it could be calculating the UV in the project, i'll check it.
OK, I was mistaken. It doesn't have UV coordinates yet. I didn't even manage to recalculate them:S. Never mind the UV stuff then, that could be your problem.
|
|
|
|
« Last Edit: June 28, 2008, 01:22:12 PM by ZaPPZion »
|
Logged
|
|
|
|
mrh_3d
Community Member

Posts: 26
|
 |
« Reply #8 on: July 01, 2008, 08:10:53 AM » |
|
thanks a lot but i don't understand that what do i do exactly? in truevision 6.2 i could set texture easily,but now i can't. i don't know anything about uv and everything you said to me please help me to find tutorial about truevision 6.5 . 
|
|
|
|
|
Logged
|
|
|
|
|
serial
|
 |
« Reply #9 on: July 02, 2008, 12:33:33 AM » |
|
Check c:\debug.txt
UV Coordinates are also got texture coordinates. They are used to map a texture to your model
|
|
|
|
|
Logged
|
|
|
|
mrh_3d
Community Member

Posts: 26
|
 |
« Reply #10 on: July 02, 2008, 01:53:53 AM » |
|
what do you do if you want to set texture ? please type your complete codes here. 
|
|
|
|
|
Logged
|
|
|
|
AriusEso
Customers
Community Member
    
Posts: 377
Esoteric
|
 |
« Reply #11 on: July 02, 2008, 06:25:09 AM » |
|
What does your debug log say?
|
|
|
|
|
Logged
|
|
|
|
mrh_3d
Community Member

Posts: 26
|
 |
« Reply #12 on: July 02, 2008, 07:01:23 AM » |
|
woooow  finally i can to set texture , but my program don't show image really ,for example if my texture is a yellow stone with black strips when i render ,it will be shown in yellow color only. what do i do ? please help me to find tutorial(s) about true vision 6.5 in vb.net
|
|
|
|
|
Logged
|
|
|
|
|
pabloescobar
|
 |
« Reply #13 on: July 02, 2008, 07:13:03 AM » |
|
fix the UV. Will be more easy if you use 3ds max (or any other 3d editor)
|
|
|
|
|
Logged
|
|
|
|
|
pizzayoyo
|
 |
« Reply #14 on: July 02, 2008, 11:28:22 AM » |
|
Try using a box instead of a teapot, as Sylvain suggested.
|
|
|
|
|
Logged
|
|
|
|
jviper
Community Member

Posts: 1366
Discipline in training
|
 |
« Reply #15 on: July 22, 2008, 12:28:01 AM » |
|
To set the texture you use the function:
TVMesh.SetTexture TVActor.SetTexture
But for the texture to show up, your model must have some kind of texture coordinates other than 0,0. I believe that the default texture coordinates for all the verticies when the teapot is created is 0,0, so you will not see a texture untill you alter the texture coordinates.
To Alter the texture coordinates, you have to alter the verticies. Tu and Tv is what needs to be altered.
TVMesh.GetVertex ... Alter the Tu and Tv ... TVMesh.SetVertex
|
|
|
|
|
Logged
|
JAbstract.....Don't just imagine, make it happen!
|
|
|
|