WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Any ideas on linking chess 3ds file with source code? (https://forum.worldviz.com/showthread.php?t=1974)

djones1010 04-19-2009 07:25 PM

Any ideas on linking chess 3ds file with source code?
 
All I need now is to link my teams chess pieces/board with the Source Code to drive to drive the pieces.

Rapidshare Link to Source Code

http://rapidshare.com/files/22340446...ss_05.zip.html

Steps to get Source Code working on Vizard

Step 1:

Click these links to download the files need to compile the Source Code in Vizard.

Download files in order as they appear

1. http://s3.worldviz.com/exe/vizard30_tkinter.exe

2. http://www.python.org/ftp/python/2.3.5/Python-2.3.5.exe

3. http://www.pygame.org/ftp/pygame-1.8...in32-py2.4.msi

djones1010 04-24-2009 09:56 PM

Need help creating chessboard
 
1 Attachment(s)
The attached file should be placed into VizardChess folder inorder to compile correctly. You can download the VizardChess folder from the link above. It creates one row of white and brown squares then stops. I help completing the rest of the board.

Code:

        def Draw(self,board,highlightSquares=[]):
                boardSize = len(board) #board should be square.  boardSize should be always 8 for chess, but I dislike "magic numbers" :)
                current_square = 0
                for r in range(boardSize):
                        for c in range(boardSize):
                                (screenX,screenY) = self.ConvertToScreenCoords((r,c))                               
                                if current_square:
                                        pic = viz.addTexture('brown_square.png')
                                        brown_square = viz.addTexQuad()
                                        brown_square.texture(pic)
                                        brown_square.scale(1,1,1)
                                        brown_square.translate(r-5, 0, 15)
                                        #self.screen.blit(brown_square,(screenX,screenY))
                                        current_square = (current_square+1)%2
                                else:
                                        pic2 = viz.addTexture('white_square.png')
                                        white_square = viz.addTexQuad()
                                        white_square.texture(pic2)
                                        white_square.scale(1,1,1)
                                        #white_square.translate(r, 0,15)
                                        white_square.translate(r-5, 0, 15)
                                        #self.screen.blit(white_square,(screenX,screenY))
                                        current_square = (current_square+1)%2
       
                        current_square = (current_square+1)%2



All times are GMT -7. The time now is 06:21 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC