Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Material Not Being applied?  (Read 1590 times)
cybertrickle
Community Member
*
Posts: 504


« on: December 28, 2002, 11:59:38 AM »

When I run this code I expect the mesh to look light blue, but its blinding white.

Code:

Public Sub InitClouds()
'    Dim BoxMin As D3DVECTOR
'    Dim BoxMax As D3DVECTOR
'    mModel.GetBoundingBox BoxMin, BoxMax, True
   
    Dim width As Single
    Dim length As Single
   
    Dim X1 As Single, Z1 As Single, X2 As Single, Z2 As Single

   
    X1 = (MapLength * Map.Size.x) * -1
    Z1 = (MapLength * Map.Size.Z) * -1
    X2 = (MapLength * Map.Size.x)
    Z2 = (MapLength * Map.Size.Z)
   
    Set mModel = scene.CreateMeshBuilder("Clouds")
    MatFactory.CreateMaterial "clouds"
    MatFactory.SetAmbient GetMat("clouds"), 0.3, 0.3, 0, 1
    MatFactory.SetDiffuse GetMat("clouds"), 0, 0, 0, 1
    MatFactory.SetEmissive GetMat("clouds"), 1, 1, 1, 0
    MatFactory.SetSpecular GetMat("clouds"), 0, 0, 0, 0
    MatFactory.SetPower GetMat("clouds"), 0
   
   
    mModel.AddFloor 0, X1, Z1, X2, Z2
    mModel.AddWall3D 0, X1, Z1, X1, Z2, -500
    mModel.AddWall3D 0, X1, Z1, X2, Z1, -500
    mModel.AddWall3D 0, X2, Z1, X2, Z2, -500
    mModel.AddWall3D 0, X1, Z2, X2, Z2, -500
    mModel.SetPosition 0, 300, 0
   
    mModel.SetMaterial GetMat("clouds")
   
   
End Sub
Logged

Evan Duffield
Dymm Inc.
_______________
Project: Journeys End
Status Code: 80%
Status Modeling: 20%
Working on:  completion of demo
Arli
Administrator
Community Member
*****
Posts: 993


« Reply #1 on: December 28, 2002, 12:33:03 PM »

Try adding a "ComputeNormals" here:

Code:

    mModel.AddFloor 0, X1, Z1, X2, Z2
    mModel.AddWall3D 0, X1, Z1, X1, Z2, -500
    mModel.AddWall3D 0, X1, Z1, X2, Z1, -500
    mModel.AddWall3D 0, X2, Z1, X2, Z2, -500
    mModel.AddWall3D 0, X1, Z2, X2, Z2, -500
    mModel.SetPosition 0, 300, 0

    mModel.ComputeNormals

Before setting the material.
Logged

Happy Coding

Arli
Truevision3D Developer
Arli@Truevision3D.com
cybertrickle
Community Member
*
Posts: 504


« Reply #2 on: December 28, 2002, 12:50:13 PM »

Thanks.. what exactly does that do anyway?
Logged

Evan Duffield
Dymm Inc.
_______________
Project: Journeys End
Status Code: 80%
Status Modeling: 20%
Working on:  completion of demo
cybertrickle
Community Member
*
Posts: 504


« Reply #3 on: December 28, 2002, 12:52:59 PM »

ah. it didnt work.
Logged

Evan Duffield
Dymm Inc.
_______________
Project: Journeys End
Status Code: 80%
Status Modeling: 20%
Working on:  completion of demo
SylvainTV
Administrator
Community Member
*****
Posts: 4479


WWW
« Reply #4 on: December 28, 2002, 01:03:15 PM »

Err

    MatFactory.SetAmbient GetMat("clouds"), 0.3, 0.3, 0, 1
    MatFactory.SetDiffuse GetMat("clouds"), 0, 0, 0, 1
    MatFactory.SetEmissive GetMat("clouds"), 1, 1, 1, 0
    MatFactory.SetSpecular GetMat("clouds"), 0, 0, 0, 0
    MatFactory.SetPower GetMat("clouds"), 0
   

this stuff seems a little weird Shocked
Try to use MatED tool to create the best material for this really..
Doesn't seem Blue :p
Logged

Regards

Sylvain Dupont
TrueVision3D Developer
sylvain@truevision3d.com

TV3D IRC at http://chat.truevision3d.com or on server irc.truevision3d.com #Truevision3D. Come talk with us !
cybertrickle
Community Member
*
Posts: 504


« Reply #5 on: December 28, 2002, 01:10:27 PM »

Lol.

But its not white either. Ill try that though.
Logged

Evan Duffield
Dymm Inc.
_______________
Project: Journeys End
Status Code: 80%
Status Modeling: 20%
Working on:  completion of demo
cybertrickle
Community Member
*
Posts: 504


« Reply #6 on: December 28, 2002, 04:54:27 PM »

thanks alot. It works now =)
Logged

Evan Duffield
Dymm Inc.
_______________
Project: Journeys End
Status Code: 80%
Status Modeling: 20%
Working on:  completion of demo
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks