Hi,I don't have XNA installed, but from glancing at your code:device is the parameter for an anonymoius function that is out of scope in the place you're trying to use it. Did you misplace the closing parenthesis of '(fun device -> draw device Color.Black)'?scene is a type (note that a naming convention for types is that they start with uppercase, "Scene"). You should provide an instance of that type instead.cheers,Kurt

By on 2/28/2009 6:44 AM ()

I fixed the typo with Scene.

On page 192-193, I get a problem with:

...

let rec draw (device : Device) color = function

| Triangles tris ->

Array.concat (List.map (triangle color) tris)

|> drawTriangles device

| Color(color, scene) -> draw device color scene

| Transform(m, scene) -> transform device color m draw scene

| Group ts -> List.iter (draw device color) ts

let printer scene =

let thread =

new System.Threading.Thread(fun () ->

(fun device -> draw device Color.Black scene)

|> show3D

|> makeViewer "F# Visualization"

|> Application.Run)

thread.SetApartmentState(Threading.ApartmentState.STA)

thread.Start()

"<scene>"

//fsi.AddPrinter(printer)

//Triangles [ vec(-1.0, -1.0, 0.0),

// vec(0.0, 1.0, -1.0),

// vec(1.0, -1.0, 0.0) ]

I don't what know the FSI is supposed to do.

By on 3/1/2009 6:49 AM ()

fsi is only defined in an F# Interactive window. In this case, the code seems to add a pretty-printer for Scene types. If you're using this in a console application of some sort, you should probably call the printer function yourself for whatever scene you're trying to show.Kurt

By on 3/1/2009 8:00 AM ()

Thank-you.

By on 3/2/2009 5:06 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper