Programming – BattleRez Tech http://www.battlereztech.com Yes, I'll totally make that VR game for you! Sun, 10 Jul 2016 16:17:05 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 http://www.battlereztech.com/wp-content/uploads/2016/11/cropped-Pixels-Back-32x32.png Programming – BattleRez Tech http://www.battlereztech.com 32 32 The Element Factory http://www.battlereztech.com/the-element-factory/ Sun, 10 Jul 2016 05:09:54 +0000 http://www.battlereztech.com/?p=89 Continue reading The Element Factory]]> The National Museum of Nuclear Science and History has a very beautiful entrance that consists of a large periodic table with each element created out of marble. The tiles are large enough for a few people to stand on them comfortably which caused them to create a “Periodic Twister” game that helped kids learn about how elements are used together to create everyday household compounds. They also have a very large touch screen table that currently had one very bland timeline application for the Pioneers of Nuclear science exhibit.

Highlands was asked to come up with a way to combine the periodic Twister game with the touch screen table without losing the previous timeline application. We discussed several ideas until we came up with “The Element Factory.” This game would consist of a periodic table that provided a timed game in which a user would be asked to complete a compound by dragging elements into a bin. This would be a multiplayer game so it must allow for many touches at once.

We were also given special permission from Theodore Gray to purge his website for anything that we would find useful for our game. We created a touch table version of a periodic table using C# and Blend in Visual Studios and then plundered his website and created the content so that a user may learn about the elements without playing the game. They can then click to play the game and race against the clock. We created the table to pull all of the elemental data from 2 files stored in google drive excel sheet.

The final step was creating an attract screen that would also handled opening and closing the older application as well as our new game. Here is what I created with Blend and C#:

nuclear_attractScreen_2

ON FACEBOOK:

Thanks to these two software designers from New Mexico Highlands University we now have an educational video game in Periodic Hall (in front of Pioneers of the Atom).

Bresdin O’malley (on left) and Simone Seagle (on right) created an interactive periodic table that teaches you about the elements, and museum visitors can play a game that challenges their knowledge on chemical compounds. What a creative solution to make the visitors experience fun, interactive and unforgettable!

4321


Concept for game 

Name: The Element Factory

Objective: Create the compounds that are shuffled each game

Game Play: Everyone will be able to click on an element in the periodic table and that element will stick to their finger. They will then drag that element to the factory bin. They must collect all needed elements to advance to the next compound. Players race against a clock to get as high of a score as possible.

If the wrong element is put into the factory it will cause an unpleasant noise and be removed.

]]>
Detroit VR http://www.battlereztech.com/detroit-vr/ Sun, 10 Jul 2016 04:30:36 +0000 http://www.battlereztech.com/?p=35 Continue reading Detroit VR]]> I spoke to my friend Rachel about my project and she mentioned that her company makes 3D models of cities all over the world. She asked her boss if it would be possible to let me use some of the models for a VR research class and her boss was enthusiastic about it and said it shouldn’t be a problem.

I set up a deal to get downtown Detroit from his company PLW . This made it it possible to use all of my time for research into the use of dual systems with the Oculus Rift DK2.

Sadly the end of this project turned into a Fly through of downtown Detroit with Leap Motion hands. The Oculus support was dropped during my semester of research. This project had to be put on hold. The following is an example of the research data.

Documentation Blog

20150927_151455

DEVELOPMENT –>

For my independent research study wanted to develop a project using Unity software with the Oculus DK2 and the Emotive headgear. After this proved to be too difficult to develop with I decided to use the Leap Motion (I also looking into a device called the MYO armband) as the secondary device instead of the Emotive. It has recently been developed to attach to the front of the Oculus DK2 and be used in conjunction with it. In the middle of the development progress I spoke with PLW Model Works in Florida who develop 3D models of cities using realistic imaging. I was offered a section of any city I wanted to add to my program. I chose downtown Detroit and after working out an agreement I was given 7 GBs worth of models. After weeks of development I ran into a very large snag with the Oculus DK2 SDK and utilities package for Unity. The census becomes apparent that the Oculus released a broken set of utilities for the most recent Unity 2.3 as well as a runtime that no longer supports Unity. They also dropped support for any Unity version before 2.3 so using older versions did not fix the issue. After also experiencing issues with the Leap SDK I started to suspect that it is actually my OS system. I am running a 64-bit Windows OS system and the Oculus SDK has a hard time running on windows 7. I had to do a lot of work and download another program to run just the demos for the Oculus.

They report to be working on this problem, however not in time for this project to be completed. Instead I was able to integrate the Leap Motion Controller without the Oculus and use my Mac OS X system for development. To expand on this project I will hopefully be able to use the Oculus and Leap together once they update the support for Unity. This project can be used to “visit” Detroit without actually going there. I also want to use the project to build community awareness of Detroit. With more time and supported SDKs this project has large potential. I am hoping to continue development and make something to show the value of using a VR device. I am also wondering about using different VR systems instead of the Oculus because of so many companies running into the same problems I have and deciding to stop building with it.

This brings up a very important aspect to building with devices such as the Oculus as there is not a lot of documentation or help. This causes so much frustration to developers that they stop using the devices and the technology dies without every reaching the full potential. This goes for other devices such as the Kinect or the MYO armband as well.

Emotiv EPOC Headset

The Emotiv EPOC headset(1) is designed with several capacitors that act as an EEG and output several numbers that can be used to control different aspects of a game or program. While there is a few examples of this being used with the Oculus online there is a lot of consensus that it is not worth the effort and trouble(2). One reason being that the Emotive headset has connectivity problems and getting it to work is a shot in the dark(3). I myself experienced this problem while trying to get the headset to connect to my own brainwaves. I believe I have to much hair for a solid connection to be made between the set and my head. Another interesting reason why the Emotive can offer frustration with games is how tiring it can be(4). “Thinking” about walking is very tiring because our body does that subconsciously, causing the “VR” experience to be distorted. After this research I decided to halt development for this project using the Emotive headset.

  1. https://emotiv.com/
  2. https://m.reddit.com/r/oculus/comments/2v7135/could_oculus_be_worn_at_the_same_time_as_emotiv/
  3. https://forums.oculus.com/viewtopic.php?t=8635
  4. http://www.roadtovr.com/topic/mind-control-emotiv-epoc/

MYO Armband

The MYO armband(1) is an arm band that reads the muscles in your arm to perform actions on the computer. I used the armband for several days and actually quite enjoyed the experience. When it is synced correctly it works very well as a device to do small tasks on the computer. One of the drawbacks was how tired my arm muscles would get and the soreness I experienced after using it. Another drawback was that there are not many gestures that it can read causing the usefulness to be low for a video game. This reason proved to be a good reason not to use it for this project because expansion with the project would be hindered.

  1. https://www.myo.com/

Leap Motion Controller

The Leap Motion Controller(1) is a device that uses cameras to detect hand movement to control objects on the computer. This device offers a very large community and many documentation sites to help developers. The developers of the Leap are also very present on the forum boards and seem to work very hard to help developers with their issues. This proved to be a very important detail for why I wanted to use the Leap for this project. Another great aspect was that they have developed integration with the Oculus DK2 rift to make development easier. The Leap can connect to the front of the Oculus with the only drawback being an added wire connected to the device(2).

Development

I downloaded the Leap SDK 2.3.1+31549 and could not get it to run on my 64-Bit Windows 7 machine. Even with similar issues that were solved on the community forums(3) I was unable to fix the issue on my OS. The Leap Controller remained OFF even with calibration working. This also may be an issue with windows 7. When I downloaded the same SDK on my Mac OS Yosemite machine it worked perfectly. I downloaded the Leap Core Assets that work on Unity 5.2+(4). These work perfectly when the prefab HandController is dragged into the scene and the camera is placed directly behind the hands. They are very small and need to be scaled up. As long as an object has a RigidBody applied to it, the hands can interact with the object(5). Once the game was built however the FPS had a very hard time drawing the hands fast enough to give it a smooth appearance.

  1. https://www.leapmotion.com/
  2. https://developer.leapmotion.com/vr-setup
  3. Fixed Leap Problem
  4. https://developer.leapmotion.com/downloads/unity
  5. https://developer.leapmotion.com/getting-started/unity

Oculus DK2 Virtual Reality Headset

The Oculus DK2 VR headset(1) proved to be such a large hassle to deal with that my project can not use the headset at this moment in time. However, it should be able to be integrated into the Unity 5 software as well as the Unreal Engine(2). It explains that Unity 4 is supported but not well and users need to update to Unity 5 soon. The Oculus Utilities to integrate into Unity also come with the Leap Motion Controller Assets. You can also attach the Leap Controller to the front of the Oculus and be able to use both together to give a better controller option for the Oculus than using the keyboard.

 

Development:

In order for the Oculus to be developed with one must download the current SDK (0.8.0 as of now), the current Unity Utilities and the most current Unity software. It is supposed to be easily integrated into Unity 5+. However, the Oculus Developers recently dropped the support for all Unity build under 5.2 and produced an SDK that is full of bugs when dealing with Unity 5.2. This has been such an awful step for them that many companies have stopped developing with Oculus entirely(2). I have even posted a question myself on the Unity forum without any response so far(3). I also found a forum where the Oculus Developers admit to not supporting Unity at this time(4). In fact, I was so confused because the Oculus and Unity Requirement page explains that it should work with Unity 5.2 but after several days of research the page now appears to be 404(5). When I started testing with the Oculus earlier in the semester it worked just fine with Unity 5.1. After I opened my project after the newest Oculus SDK was released it no longer worked without upgrading Unity to 5.2. This fixed the errors I was getting but The headset stopped turing on and being available through Unity even when I built the program. I tried all the different SDKs, Unity Versions and the Utilities with zero success. I did the following table for Oculus SDK 0.6 and Oculus SDK 0.7 with different errors being produced for each SDK.

Oculus Utilities -> 0.1.0 0.1.2.0 0.1.2.3.0
Unity Builds
5.0.0 X X X
5.1.1 X X X
5.2.1 X X X

 

As of May 2015, Oculus dropped all support for OS Mac X and the last known SDK to work is 5.1 with no Unity Utilities to develop while using a Mac (7 & 8).

  1. https://www.oculus.com/en-us/dk2/
  2. https://developer.oculus.com/documentation/game-engines/latest/
  3. http://answers.unity3d.com/questions/1037902/oculus-rift-not-working-with-unity-5.html
  4. http://answers.unity3d.com/questions/1104992/oculus-dk2-unresponsive-for-unity-52-windows.html
  5. https://forums.oculus.com/viewtopic.php?t=26063
  6. https://developer.oculus.com/documentation/game-engines/unity-req/
  7. https://answers.oculus.com/search.html?f=&type=question&redirect=search%2Fsearch&sort=relevance&q=max+os
  8. http://www.macworld.com/article/2922722/no-oculus-rift-for-the-mac-but-your-mac-couldnt-handle-it-anyway.html
]]>
Scratch Programming Intro – Maze Game http://www.battlereztech.com/scratch-programming-intro-maze-game/ Fri, 15 Apr 2016 03:37:15 +0000 http://www.battlereztech.com/?p=68 Continue reading Scratch Programming Intro – Maze Game]]> Objective:

Introduce, demonstrate and facilitate using Scratch Programming and a makey makey controller.

Goals:

Create a video game

Create an animation scene

Merge video game and animation

Use makey makey to control game

  1. Introduce Scratch
    1. www.scratch.com
    2. Offer to create an account for saving purposes
    3. Click “Create”
  2. Background
    1. Show off images
    2. Find the X/Y coordinate image
    3. Demonstrate making a personalized backdrop
  3. Sprites
    1. Show off sprite images
    2. Demonstrate how to make your own sprite
    3. Grow / Shrink buttons
    4. Open X / Y Coord and show how to place sprite and where it is on the grid
  4. Scripts
    1. Make sure X/Y coord backdrop is open
    2. Event
      1. When Flag clicked to start program
    3. Control
      1. Forever loop
      2. If else loops
    4. Sensing
      1. (Sensing)Left, right buttons are clicked something will happen
      2. (Add to control loops)
      3. (Sensing) Show video ** ONLY IF TIME
    5. Looks
      1. (Looks)Change the costume
      2. (Looks)Say something
    6. Motion
      1. (Motion)Change by x
      2. (Motion)Change by y
      3. Positive and negative values
    7. Hitting a wall
      1. (Sensing)If hitting a certain color then reset sprite
    8. Reset Sprite
      1. (Motion)Reset sprite on start as well
    9. Point in direction
      1. (Motion)Point in direction left or right
    10. Backdrop
      1. (Looks) Change to next background
      2. (Sound) Add Sound
      3. (Scripts on BG) Add a sound script
]]>
Scratch Tutorial Game – Brick Breaker / Pong Game http://www.battlereztech.com/scratch-tutorial-game-brick-breaker-pong-game/ Fri, 15 Apr 2016 03:30:13 +0000 http://www.battlereztech.com/?p=63 Continue reading Scratch Tutorial Game – Brick Breaker / Pong Game]]> This tutorial was written by Allie Burnquist for Start-Up Studio at the Natural History Museum in Albuquerque, New Mexico. It describes a Brick Breaker / Pong Paddle Type game.

  • Create New Project
      1. File: New
      2. Rename Project
      3. Right-Click Cat Sprite and select Delete
  • Create Paddle
      1. Option 1 – Choose new Sprite from Library
      2. Option 2 – Paint new Sprite and name it Paddle
  • Give your Paddle Sprite Motion
      1. Events: Add when flag clicked
      2. Motion: Add go to X: 0  Y: -150
        1. Test: Move your Paddle Sprite anywhere on the Stage and then press the flag on the upper right hand of the Stage. Does your Paddle move back to the starting position?
      3. Control: Add a forever loop under the Motion command
      4. Control: Add an if/then statement inside of the forever loop
      5. Sensing: Add key space pressed? block into the if/then statement. Select the drop down menu on the key space pressed and select right arrow
      6. Motion: Add change x by 10 inside the if/then statement under the key right arrow pressed then and change 10 to 15
        1. Test: Press the flag again to reset the Paddle and press the right arrow key. Does your paddle move right?
      7. Select if/then statement and drag out of the forever loop. Select the duplicate stamp and stamp the if/then statement to create a duplicate. Drag one under the other until they attach. Drag both back into the forever loop.
      8. Select the drop down menu on key right arrow pressed in the second if/then statement, then select left arrow. Change move 15 steps to -15 steps inside of the second if/then statement.
        1. Test: Press the flag again to reset the Paddle and press the left arrow key. Does your paddle move left? Now try the right arrow key. Does that still work?
        2. Note: At any time you can use the duplicate, delete, shrink or grow an item. You can also copy Script from one Sprite to another by grabbing the Script and dragging it over the Sprite you wish to copy to.
  • File: Save Now

Now we have a Paddle that moves both left and right. Time to work on our Ball.

  • Create Ball
      1. Option 1 – Choose new Sprite from Library
      2. Option 2 – Draw new Sprite and Name it Ball
  • Give your Ball Sprite Motion
      1. Events: When flag clicked
      2. Motion: Go to X: 0  Y: 190
        1. Test: Move your Ball Sprite anywhere on the Stage and then press the flag on the upper right hand of the Stage. Does your Ball move back to the starting position?
      3. Motion: Point in direction 90 under Motion command
      4. Operators: Add pick random 1 to 10 into the point in direction, replacing the 90. Change the 1 to 10 and the 90 to 225
      5. Control: Add a forever loop under the Motion command
      6. Motion: Add move 10 steps into the forever loop and change 10 to 15
        1. Test: Press the flag again to reset the Paddle and activate the Ball. What happened to the ball? Try pushing the flag a few more times. Does the ball come down too fast? Try adding a wait 1 second Control before the forever loop. Play with the time. I like .5 seconds. How do we get the ball to bounce back?
      7. Motion: Add if on edge bounce into the forever loop under move 15 steps.
  • File: Save Now

Now we have a moving Paddle and bouncing Ball, but we need to stop the ball from going through the Paddle.

      1. Control: Add an if/then statement inside of the forever loop under the if on edge, bounce Motion
      2. Sensing: Add touching? block Select the drop down menu and select Paddle.
      3. Motion: Add point in direction 90 under touching Paddle
      4. Operators: Add pick random 1 to 10 into the point in direction, replacing the 90. Change the 1 to 90 and the 30 to -30
        1. Test: Press the flag again to reset the Paddle and activate the Ball. Use your right and left arrows to move the Paddle and stop the ball from hitting the bottom of the Stage
  • File: Save Now
  • Prepare the Backdrop and Add Sound
      1. Stage: Backdrops
      2. Add a rectangle along the bottom of the Stage
      3. Select Ball Sprite: Scripts
  • Controls: Add if/then statement inside the forever loop under the first if/then statement
  • Sensing: Add touching color? into the if/then statement. Click the square of color in the touching color? block then select the rectangle on the bottom of the Stage
  • Sound: Add play sound pop into the if/then statement under touching color? block
  • Controls: Add stop all into the if/then statement under play sound pop Sound
  • Test: Press the flag again to reset the game and try to play. Where did the sound go? Stop all ends up stopping the sound before it starts. Try placing a wait 1 second block between the play sound pop and stop all. Try playing with the time until you find one that works. I like .05. Once you find the right time, try to play the game again. Does everything work now? How could the game be better?
  • File: Save Now

If everything is working right there are a few more things we can add to make our video game more dynamic.

  • Adding a Game Over Screen
    1. Option 1 – Choose new Backdrop from Library
    2. Option 2 – Paint new Backdrop
    3. Add text and decorate the page however you would like and move back to the Script for Ball Sprite by clicking on the Ball Sprite
    4. Looks: Add switch backdrop to block in the second if/then statement in the forever loop between the play sound pop and wait .05 seconds. Select the drop down menu on the switch backdrop to block to backdrop 2
    5. Select backdrop 1 in backdrops and press the flag to see if it works. Want to hide the Ball and Paddle Sprites when the Game Over Screen comes up?
    6. Looks: Add hide block into the second if/then statement in the forever loop between switch backdrop to block and wait .05 seconds block and try again.
    7. Events: Add broadcast block into the second if/then statement in the forever loop between hide block and wait .05 seconds block. Select the drop down menu and choose new message and name the message Game Over.
    1. Select the Paddle Sprite
    2. Events: Add when I receive to the Script. Select the drop down menu and choose Game Over message
    3. Looks: Add hide block to the when I receive Game Over event

Right now the Ball and Paddle are hidden so we need to add a show command.

      1. Events: Add when space key pressed. Select the drop down menu and select space
      2. Looks: Add show block to when space key pressed
      3. Select go to X: 0  Y: -150 and drag script away from when flag clicked block and move to the when space key pressed block under show block
      4. Looks: Add hide block to when flag clicked
  • File: Save

This is the final Script for the Paddle! We want to match the start commands with the Ball, so select the Ball Sprite to change the Script and repeat the previous steps.

    1. Events: Add when space key pressed. Select the drop down menu and select space
    2. Looks: Add show block to when space key pressed
    3. Select go to X: 0  Y: 190 and drag script away from when flag clicked block and move to the when space key pressed block under show block
    4. Looks: Add hide block to when flag clicked
  • File: Save

This is the final Script for the Ball Sprite. Next we will create a title screen

  • Adding a Title Page
      1. Option 1 – Choose new Backdrop from Library
      2. Option 2 – Paint new Backdrop
      3. Add text and decorate the page however you would like. Press Script at the top of your work area next to Backdrops.
      4. Events: Add when flag clicked
      5. Looks: Add switch backdrop to block. Select the drop down menu and select the background you created for a Title screen. Mine is called Backdrop 3
      6. Controls: Add forever loop under the Looks command
      7. Controls: Add if/then statement into the forever loop
      8. Sensing: Add key pressed? block into the if/then statement
      9. Looks: Add switch backdrop to block to the if/then statement under the key pressed block. Select the drop down menu and select the game play backdrop with your rectangle at the bottom of the screen. Mine is called Backdrop 2.
        1. Test: Click the flag in the upper right hand corner of the Stage area and play your game. Does everything work? What else could we add?
  • File: Save

This is the final Script for the Backdrops. Now we can either add a score counter.

  • Adding a Score Counter
    1. Select Ball Sprite to enter Ball Sprit Script
    2. Events: Add when flag clicked
    3. Data: Select make a variable and name variable Score (make sure for all Sprites is selected) and check mark Score variable
    4. Data: Add hide variable to when flag clicked block. Select drop down menu and select Score
    5. Events: Add when key pressed block. Select drop down menu and select space.
    6. Data: Add show variable to when space key pressed. Select drop down menu and select Score
    7. Data: Add set to under set variable Score. Select drop down menu and select Score set blank number to 0
    8. Control: Add forever loop under set score to 0 block
    9. Control: Add if/then statement inside forever loop
    10. Sensing: Add touching? block to if/then statement. Select drop down menu and select Paddle
    11. Data: Add change by block to if/then statement under touching paddle? block. Select drop down menu and select Score and set blank number to 1
]]>
Summer 2016 Innovate and Create Camp Week by Week Lesson Plan http://www.battlereztech.com/summer-2016-innovate-and-create-camp-week-by-week-lesson-plan/ Fri, 15 Apr 2016 03:21:01 +0000 http://www.battlereztech.com/?p=57 Continue reading Summer 2016 Innovate and Create Camp Week by Week Lesson Plan]]>

Camp Website

Podcasts!

Camp will be 4 weeks long starting between June 1st and July 31st. We will have a week off in between each class to prepare for the next week.

Each day will be split into two blocks, one being taught by Victoria and one being taught by Bresdin. The girls will spend half of their day in one block and the second half in the other. This will also provide a way for new girls to be caught up on past objectives they missed in previous weeks with the other girls can advance.

Each girl will create a website / blog on the first day that will continue to be updated by them as the weeks go on. They will be virtual scrapbooks. During this time we will teach them internet safety and guidelines. Will need email signature forms for this

Objective:

To teach the girls how to work together as a team to complete a complex large goal such a creating a video game.

  • Storyboarding
  • Audio Mixing
  • Graphic Design
  • Website / Blogging
  • Internet Safety
  • Creating a board game
  • 3D printing
  • 3D modeling
  • Story Writing / Character creation
  • Scratch Programming
  • Processing (Java Programming)
  • Teamwork
  • Communication
  • Unity Development
  • (App Development?)
  • Game Jam

Week 1:

Objectives:

Learning various computer skills and art techniques that will help them in the coming weeks.

  1. (Graphic Design) Learning to clean up their drawings and photos on the computer.
    • Photoshop and Illustrator
      • This will be used later on when creating a board game and video game.
      • Using photoshop and illustrator to learn how to storyboard a story or scene.
      • Use to enhance their website
    • Drawing or painting
      • Learn how to storyboard a story or scene.
    • Typography and Color choices?
  2. Internet Safety and Culture
    • Safe Passwords
    • Malicious downloads
    • Internet predators and how to avoid this
    • Using search engines
    • ECT….
  3. Audio Mixing
    • Very important skill to use when creating a video game
    • Garageband
    • Little Bits
    • Sound recording
    • Will use in the following weeks many times
  4. Website building
    • Wix or wordpress
    • Blog format created by them personally
    • Will use skills each day to update and enhance website
    • Will be used to take notes and or publish the video game to later

Possible Guest Speakers:

Analisa or Jenna (Need to talk to Mariam)

Week 2:

Objectives:

Learning the elements to a game – Creating a board game individually and as a team.

  1. Playing and learning about different board games
  • This will help them learn the elements to games to create a video game on week 4
    • Defining what is a rule
    • creating characters
    • using cards
    • using pieces
    • Types of games – strategy, cards, chance ect
    • Themes
  • Writing and Storytelling
      • This will help when needing to come up with a video games storyline (If they choose to) Individually writing as well as group writing.
    • How to create characters / Creating heroes and heroines
    • Writing a plot line
    • Creating a theme
    • creating an experience
  • 3D Modeling
    • Will design 3D pieces for the board game
    • Tinkercad
    • Blender
  • 3D Printing
    • Will print pieces for the board game

Possible Guests

Jared Tarbel could lazer cut their board game design?

Chris McKillip sp-ent.com Makes and published aboard game. Local Video media company

Week 3:

Objective:

Teach programming and game development

  1. Scratch
    • Teach low level game design
  2. Processing
    • Teach low level programming
  3. Unity
    • Combine Scratch and processing
  4. 3D modeling and using in unity
    • Using their skills from previous weeks
  5. Turn board game into a video game
    • Turn previous weeks board game into video game to show how it is the same process
  6. Storyboarding
    • Continue to write and storyboard their games
  7. Testing and bug fixing
    • Learning how to make the game fun and get rid of pesky bugs in the game

Possible Guests:

Sean McCracken (If available – or might have him there next week)

Week 4:

Objective: Girl Scout Game Jam in Unity

Have the girls create a video game in one week as a team using communication and all previous skills picked up.

  1. All girls will work together to get different elements finished
    1. 3D modelers, writers, storyboarding, programming
  2. Come up with theme
  3. Create environments
  4. Create Characters
]]>
Unity 3D Level Design Tutorial for Innovate and Create http://www.battlereztech.com/unity-3d-level-design-tutorial-for-innovate-and-create/ Fri, 15 Apr 2016 03:16:40 +0000 http://www.battlereztech.com/?p=52 Continue reading Unity 3D Level Design Tutorial for Innovate and Create]]> The following is the list I move through to introduce a workshop to Unity 3D:

Create a New Scene

>New Project

Give Name

Choose Desktop

3D is chosen

>Create Project

Objects

Hierarchy > Look at Main Camera, Directional Light

GameObject > 3 > Cube

Delete the light!!!

CTL + Z to get it back

GameObject > Light > Directional Light

Controls

Scroll Wheel – zoom in and out

Click and hold the scroll wheel – Grab scene left to right

Hold Right btn – Look Left to right

click CUBE to focus on cube

Click four directions btn > move cube

Click Turn button > rotate cube

Click Size btn > Change size

Click Morph btn > Change obj

click Hand to not do anything

Delete the cube

Add Terrain

GameObject > 3D Object > Terrain

Mesh to sculpt for terrain

Look in Assets

Moving about the scene

Scroll Wheel – zoom in and out

Click and hold the scroll wheel – Grab scene left to right

> Play

Move Camera

Create Controller

Look on desktop

Drag folder that says standard assets into unity

Wait

OR

Window > Asset Store > Unity Essentials > Asset Packs > Standard Assets > Download > Import(after download)

In unity:

Click Standard Assets > Characters > FirstPersoncontroller>Prefab

(a prefabricated Object.)

Drag onto scene

Unclick Main Camera

Play

OR

Assets> standard assets > characters > ThirdPersoncontroller > Prefabs

Take main camera and drag until you make it a part of the person.

Move the camera so that it looks at the person

Inspector

This will provide the tools to sculpt the terrain

Click on Terrain

Raise Terrain

choose brush and size and go

Lower Terrain

Hold shift and click

Smooth Height

smooth the terrain

Paint Textures

Edit Textures > add Texture > Paint

Keep adding textures

Detail Tree

AddTree > gameobject > choose tree > paint

Keep adding!

Paint details

Edit details

play with settings

Creating an application

Code for Exit button :

void Update() { if (Input.GetKey(KeyCode.Escape)) { Application.Quit(); } }

 

drag that script onto the camera

 

File > build settings > PC or Mac > Build.

this can be uploaded onto the drive and played at home.

]]>
Innovate and Create Camp – Girl Scouts http://www.battlereztech.com/innovate-and-create-camp-girl-scouts/ Fri, 15 Apr 2016 03:08:11 +0000 http://www.battlereztech.com/?p=50 Continue reading Innovate and Create Camp – Girl Scouts]]> My Americorp Summer 2016 Internship is working for the Girl Scouts and helping to create and run the camp called Innovate and Create.

The following are links if you are interested in the lessons used during the camp:

Click here to view the Week by Week Lesson Plan –>

Click here to view a tutorial I created for Unity 3D level design –>

Click here to view a tutorial I created for Scratch Maze Video Game –>

Click here to view a tutorial for a Scratch Paddle Game created by Allie Burnquist –>

]]>
OpenGL http://www.battlereztech.com/opengl/ Thu, 17 Mar 2016 21:11:16 +0000 http://www.battlereztech.com/?p=31 Continue reading OpenGL]]> odysseusfrozenodie

I took an OpenGL class at Central New Mexico while getting my Associates in programming. The class was offered after multiple sessions of begging the professor for it. This class was not only challenging but the most fun I have ever had in the programming world at the time.

This pictures above are from a program I created called “Watcher & Creature” and was designed to build two characters out of shapes and have one object (Creature) run around the scene while the other’s eyes followed (Watcher) the Creature.

My partner was in charge of the Watcher and I was in charge of the Creature. We decided to have Odysseus fight Medusa for our scene.

Here is my code to create the Creature Object:

 


/*************************
* odysseus.h
*************************/

#ifndef ODYSSEUS_H
#define ODYSSEUS_H

//#include <windows.h>
//#include <gl/freeglut.h>
#include <GLUT/glut.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <math.h>
//#include <gl/glut.h>

class Odysseus
{
private:
  GLfloat x, y, z, size, X, Z, Yaw;
  GLUquadricObj *qobj1;
  GLfloat legSwing, legBend, RLegSwing, RLegBend;
  GLboolean LegForward, LegBendForward;
  GLuint index;

public:
  Odysseus();
  Odysseus(GLfloat x, GLfloat z, GLfloat yaw=0.0);
  void Render();
  void RenderFrozen();
  void DrawMe();
  void Bottom(bool stone);
  void Torso(bool stone);
  void HeadNeck(bool stone);
  void RightArm(bool stone);
  void LeftArm(bool stone);
  void LegUpper(bool stone);
  void LegLower(bool stone);
  void RotateLocalY(GLfloat angle);
  void FowardMove(GLfloat unit);
  void BackMove(GLfloat unit) {FowardMove(-unit);}
  void ObjectSize(GLfloat s){size = s;}
  void GetMyPos(GLfloat &rX, GLfloat &rY, GLfloat &rZ);
};

#endif

/*************************
* odysseus.cpp
*************************/
#include <GLUT/glut.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <math.h>
#include "bomOdysseus.h"

#define PI 3.14159265
#define ToRad(x) PI * x / 180.0f
#define ToDeg(x) 180.0f * x / PI

Odysseus::Odysseus()
{
  X = Z = 0.0f;

  Yaw = 0.0f;
  size = 5.0f;
}

Odysseus::Odysseus(GLfloat x, GLfloat z, GLfloat yaw)
{

  this->x = x;
  this->y = y;

  X = x;
  Z = z;

  Yaw = yaw;
  size = 5.0f;
  LegForward = true;
  LegBendForward = true;

}

void Odysseus::Render()
{
  glPushMatrix();

    glTranslatef(X, size, Z);
    glRotatef(Yaw, 0.0, 1.0, 0.0);
    glTranslatef(-50, 0, 0);
//--------------------------------------------- Drawing the head  
    
    glPushMatrix();
      glCallList(index);
    glPopMatrix();

//--------------------------------------------- Arms L&R

    glPushMatrix();
      glCallList(index + 1);
    glPopMatrix();

    glPushMatrix();
      glCallList(index + 2);
    glPopMatrix();

//--------------------------------------------- Torso

    glPushMatrix();
      glCallList(index + 3);
    glPopMatrix();

//--------------------------------------------- Bottom

    glPushMatrix();
      glCallList(index + 4);
    glPopMatrix();

//--------------------------------------------- Legs
    glPushMatrix();
      glTranslatef(55, 23, 0);
      glRotatef(legSwing, 1, 0, 0);
      glCallList(index + 5);
      glRotatef(legBend, 1, 0, 0);
      glCallList(index + 6);
    glPopMatrix();
    //------------- RIGHT LEG
    glPushMatrix();
      glTranslatef(47, 23, 0);
      glRotatef(RLegSwing, 1, 0, 0);
      glCallList(index + 7);
      glRotatef(-RLegBend, 1, 0, 0);
      glCallList(index + 8);
    glPopMatrix();

  glPopMatrix();
}

void Odysseus::RenderFrozen()
{
  glPushMatrix();

    glTranslatef(X, size, Z);
    glRotatef(Yaw, 0.0, 1.0, 0.0);
    glTranslatef(-50, 0, 0);
//--------------------------------------------- Drawing the head  
    
    glPushMatrix();
      glCallList(index + 9);
    glPopMatrix();

//--------------------------------------------- Arms L&R

    glPushMatrix();
      glCallList(index + 10);
    glPopMatrix();

    glPushMatrix();
      glCallList(index + 11);
    glPopMatrix();

//--------------------------------------------- Torso

    glPushMatrix();
      glCallList(index + 12);
    glPopMatrix();

//--------------------------------------------- Bottom

    glPushMatrix();
      glCallList(index + 13);
    glPopMatrix();

//--------------------------------------------- Legs
    glPushMatrix();
      glTranslatef(55, 23, 0);
      glRotatef(legSwing, 1, 0, 0);
      glCallList(index + 14);
      glRotatef(legBend, 1, 0, 0);
      glCallList(index + 15);
    glPopMatrix();
    //------------- RIGHT LEG
    glPushMatrix();
      glTranslatef(47, 23, 0);
      glRotatef(RLegSwing, 1, 0, 0);
      glCallList(index + 16);
      glRotatef(-RLegBend, 1, 0, 0);
      glCallList(index + 17);
    glPopMatrix();

  glPopMatrix();
}

void Odysseus::DrawMe()
{
  qobj1 = gluNewQuadric();
  index = glGenLists(18);
  
  //Regular Odysseus
  //--------------------------------------------- Drawing the head  
    
  glNewList(index, GL_COMPILE);
    HeadNeck(false);
  glEndList();

  //--------------------------------------------- Arms L&R

  glNewList(index + 1, GL_COMPILE);
    RightArm(false);
  glEndList();

  glNewList(index + 2, GL_COMPILE);
    LeftArm(false);
  glEndList();

  //--------------------------------------------- Torso

  glNewList(index + 3, GL_COMPILE);
    Torso(false);
  glEndList();

  //--------------------------------------------- Bottom

  glNewList(index + 4, GL_COMPILE);
    Bottom(false);
  glEndList();

  //--------------------------------------------- Legs
  glNewList(index + 5, GL_COMPILE);
    LegUpper(false);
  glEndList();

  glNewList(index + 6, GL_COMPILE);
    LegLower(false);
  glEndList();

  //------------- RIGHT LEG
  glNewList(index + 7, GL_COMPILE);
    LegUpper(false);
  glEndList();

  glNewList(index + 8, GL_COMPILE);
    LegLower(false);
  glEndList();

  //Stone Odysseus
  //--------------------------------------------- Drawing the head  
    
  glNewList(index + 9, GL_COMPILE);
    HeadNeck(true);
  glEndList();

  //--------------------------------------------- Arms L&R

  glNewList(index + 10, GL_COMPILE);
    RightArm(true);
  glEndList();

  glNewList(index + 11, GL_COMPILE);
    LeftArm(true);
  glEndList();

  //--------------------------------------------- Torso

  glNewList(index + 12, GL_COMPILE);
    Torso(true);
  glEndList();

  //--------------------------------------------- Bottom

  glNewList(index + 13, GL_COMPILE);
    Bottom(true);
  glEndList();

  //--------------------------------------------- Legs
  glNewList(index + 14, GL_COMPILE);
    LegUpper(true);
  glEndList();

  glNewList(index + 15, GL_COMPILE);
    LegLower(true);
  glEndList();

  //------------- RIGHT LEG
  glNewList(index + 16, GL_COMPILE);
    LegUpper(true);
  glEndList();

  glNewList(index + 17, GL_COMPILE);
    LegLower(true);
  glEndList();

  gluDeleteQuadric( qobj1);
}

void Odysseus::HeadNeck(bool stone)
{  
//-------------------------------------- Neck  
    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 196, 147);
      glTranslatef(50, 48, 0);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
      gluCylinder(qobj1, 3.0, 3.0, 5.0, 10, 5);
    glPopMatrix();
  
    // --- GOLD -->
    if(stone)
      glColor3ub(200, 200, 200);
    else
      glColor3ub(255, 194, 52);

  //------------------ helmet 
    glPushMatrix();
      glTranslatef(50, 54, 0);
      glutSolidSphere(7, 15, 20);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 54, 0);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      glRotatef(80.0f, 1.0f, 0.0f, 0.0f);
      gluCylinder(qobj1, 7.1, 7.1, 7, 20, 5);
    glPopMatrix();

    //---------------------- front mask

    //------ BLACK -->
    if(stone)
      glColor3ub(120, 120, 120);
    else
      glColor3ub(0, 0, 0);
    glPushMatrix();
      glTranslatef(50, 53, 7.2);
      gluQuadricDrawStyle(qobj1, GLU_FILL);
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      gluPartialDisk(qobj1, 0.0, 4.0, 20, 4, -90.0, 180.0);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 51.5, 7.3);
      gluQuadricDrawStyle(qobj1, GLU_FILL);
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      glScalef(2, 4, 1);
      glutSolidCube(2);
    glPopMatrix();

    //--------------------------- Head deco
    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(176, 93, 30);
      glTranslatef(50, 60, 0);
      gluQuadricDrawStyle(qobj1, GLU_FILL);
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      glScalef(2, 3, 2);
      glutSolidCube(2);
    glPopMatrix();

    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(176, 93, 30);
      glTranslatef(50, 59, -3);
      gluQuadricDrawStyle(qobj1, GLU_FILL);
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      glScalef(2, 3, 2);
      glutSolidCube(2);
    glPopMatrix();

    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(176, 93, 30);
      glTranslatef(50, 57, -5);
      gluQuadricDrawStyle(qobj1, GLU_FILL);
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      glScalef(2, 3, 2);
      glutSolidCube(2);
    glPopMatrix();

    //-------- red
    if(stone)
      glColor3ub(200, 200, 200);
    else
      glColor3ub(255, 0, 0);

    glPushMatrix();
      glTranslatef(50, 65, 2);
      glutSolidSphere(3, 15, 20);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 65, 0);
      glutSolidSphere(3, 15, 20);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 65, -2);
      glutSolidSphere(3, 15, 20);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 64, -4);
      glutSolidSphere(3, 15, 20);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 62, -6);
      glutSolidSphere(3, 15, 20);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 60, -8);
      glutSolidSphere(3, 15, 20);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 58, -9);
      glutSolidSphere(3, 15, 20);
    glPopMatrix();

}
void Odysseus::RightArm(bool stone)
{
//------------- Right 
  //--------- Quad
  glPushMatrix();
    if(stone)
      glColor3ub(200, 200, 200);
    else
      glColor3ub(255, 196, 147);
    glTranslatef(62, 39, 0);
    gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
    gluQuadricNormals(qobj1, GLU_FLAT);
    glRotatef(80.0f, 1.0f, 0.0f, 0.0f);
    gluCylinder(qobj1, 2, 2, 8.0, 20, 5);
  glPopMatrix();

  //-------------- Right joint
  glPushMatrix();
    glTranslatef(62, 30, 1.5);
    glutSolidSphere(2.5, 15, 15);
  glPopMatrix();

  //------------- lower
  glPushMatrix();
    glTranslatef(62, 30, 2);
    gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
    gluQuadricNormals(qobj1, GLU_FLAT);
    gluCylinder(qobj1, 2, 2, 8.0, 20, 5);
  glPopMatrix();

  //-------------- Right hand
  glPushMatrix();
    glTranslatef(62, 30, 10);
    glutSolidSphere(2.5, 15, 15);
  glPopMatrix();

  //-------------------------------------- Shield
    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 194, 52);
      glTranslatef(61, 30, 12.5);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      gluDisk(qobj1, 0, 10, 20, 4);
    glPopMatrix();
    
    //--------------- decorations
    glPushMatrix();
      if(stone)
        glColor3ub(120, 120, 120);
      else
        glColor3ub(0, 0, 0);
      glTranslatef(61, 30, 12.6);
      gluQuadricDrawStyle(qobj1, GLU_LINE); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_NONE);
      gluDisk(qobj1, 0, 10, 20, 4);
    glPopMatrix();

    glPushMatrix();
      if(stone)
        glColor3ub(120, 120, 120);
      else
        glColor3ub(0, 0, 0);
      glTranslatef(61, 30, 12.7);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      gluDisk(qobj1, 0, 8, 20, 4);
    glPopMatrix();

    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 194, 52);
      glTranslatef(61, 30, 12.8);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      gluDisk(qobj1, 0, 6, 20, 4);
    glPopMatrix();

      glPushMatrix();
      if(stone)
        glColor3ub(120, 120, 120);
      else
        glColor3ub(0, 0, 0);
      glTranslatef(61, 30, 12.9);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      gluDisk(qobj1, 0, 4, 20, 4);
    glPopMatrix();

    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 194, 52);
      glTranslatef(61, 30, 13);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_SMOOTH);
      gluDisk(qobj1, 0, 2, 20, 4);
    glPopMatrix();
    //---------- end wire circle
    glPushMatrix();
      if(stone)
        glColor3ub(120, 120, 120);
      else
        glColor3ub(0, 0, 0);
      glTranslatef(61, 30, 13.1);
      gluQuadricDrawStyle(qobj1, GLU_LINE); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_NONE);
      gluDisk(qobj1, 0, 2, 5, 4);
    glPopMatrix();
    
}

void Odysseus::LeftArm(bool stone)
{
  if(stone)
    glColor3ub(200, 200, 200);
  else
    glColor3ub(255, 196, 147); //skin color
//--------------------- LEft arm if looking directly at him
  glPushMatrix();
    glTranslatef(39, 40, 0);
    gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
    gluQuadricNormals(qobj1, GLU_FLAT);
    glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
    glRotatef(-30.0f, 1.0f, 0.0f, 0.0f);
    gluCylinder(qobj1, 2, 2, 8.0, 20, 5);
  glPopMatrix();

  //-------------- Left joint
  glPushMatrix();
    glTranslatef(32, 44, 0);
    glutSolidSphere(2.5, 15, 15);
  glPopMatrix();

  //---------------- Lower joint
  glPushMatrix();
    glTranslatef(32, 44, 0);
    gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
    gluQuadricNormals(qobj1, GLU_FLAT);
    glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
    glRotatef(-110.0f, 1.0f, 0.0f, 0.0f);
    gluCylinder(qobj1, 2, 2, 8.0, 20, 5);
  glPopMatrix();

  //-------------- Left Hand
  glPushMatrix();
    glTranslatef(35, 52, 0);
    glutSolidSphere(2.5, 15, 15);
  glPopMatrix();

  //--------------- Sword
  if(stone)
    glColor3ub(200, 200, 200);
  else
    glColor3ub(176, 93, 30);
  //-------- HILT
  glPushMatrix();
    glTranslatef(36, 54, 0);
    glRotatef(-23.0f, 0.0f, 0.0f, 1.0f);
    glScalef(3, 0, 3);
    glutSolidSphere(1.5, 15, 15);
  glPopMatrix();

  glPushMatrix();  
    glTranslatef(35, 52, 0);
    gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
    gluQuadricNormals(qobj1, GLU_FLAT);
    glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
    glRotatef(-110.0f, 1.0f, 0.0f, 0.0f);
    gluCylinder(qobj1, 1.2, 1.2, 3.0, 20, 5);
  glPopMatrix();

  //------------- blade
  glPushMatrix();
    if(stone)
      glColor3ub(200, 200, 200);
    else
      glColor3ub(176, 175, 173);
    glTranslatef(36, 54.5, 0);
    gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
    gluQuadricNormals(qobj1, GLU_FLAT);
    glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
    glRotatef(-110.0f, 1.0f, 0.0f, 0.0f);
    gluCylinder(qobj1, 1, 0, 20.0, 20, 5);
  glPopMatrix();
  
}
void Odysseus::Torso(bool stone)
{
//--------------------------------------------- Drawing the Torso  
    if(stone)
      glColor3ub(200, 200, 200);
    else
      glColor3ub(255, 196, 147);
    //-------------- Right Shoulder when looking at him
    glPushMatrix();
      glTranslatef(61, 40, 0);
      glutSolidSphere(3, 15, 15);
    glPopMatrix();

    //---------------- Left SHoulder
    glPushMatrix();
      glTranslatef(39, 40, 0);
      glutSolidSphere(3, 15, 15);
    glPopMatrix();

    
//--------------------------------------------- chest 
    //------- right 
    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 255, 255);
      glTranslatef(50, 40, 0);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
      gluCylinder(qobj1, 6.0, 3.0, 10.0, 10, 5);
    glPopMatrix();
    //----------------- left
    glPushMatrix();
      glTranslatef(50, 40, 0);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
      gluCylinder(qobj1, 6.0, 3.0, 10.0, 10, 5);
    glPopMatrix();

    glPushMatrix();
      glTranslatef(50, 40, 0);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
      gluCylinder(qobj1, 6.0, 7.0, 15.0, 10, 5);
    glPopMatrix();

    //-------------------------------------- Belt
    
}

void Odysseus::Bottom(bool stone)
{
//--------------------------------------------- Drawing the bottom
    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 255, 255);
      glTranslatef(50, 25, 0);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
      gluCylinder(qobj1, 7.0, 10.0, 10.0, 10, 5);
    glPopMatrix();

    //-------------------------------------- Belt
    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 194, 52);
      glTranslatef(50, 26, 0);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
      gluCylinder(qobj1, 7.2, 7.2, 3.0, 10, 5);
    glPopMatrix();

    //-------------------------------------- Flat disk

    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 194, 52);
      glTranslatef(50, 25, 8);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      gluDisk(qobj1, 0.0, 3.0, 20, 4);
    glPopMatrix();

    glPushMatrix();
      if(stone)
        glColor3ub(120, 120, 120);
      else
        glColor3ub(0, 0, 0);
      glTranslatef(50, 25, 8.1);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      gluDisk(qobj1, 0.0, 2.0, 20, 4);
    glPopMatrix();

    glPushMatrix();
      if(stone)
        glColor3ub(200, 200, 200);
      else
        glColor3ub(255, 194, 52);
      glTranslatef(50, 25, 8.2);
      gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
      gluQuadricNormals(qobj1, GLU_FLAT);
      gluDisk(qobj1, 0.0, 1.0, 20, 4);
    glPopMatrix();
}

void Odysseus::LegUpper(bool stone)
{
  if(stone)
    glColor3ub(200, 200, 200);
  else
    glColor3ub(255, 196, 147);
  glPushMatrix();
    glTranslatef(0, 0, 0);
    gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
    gluQuadricNormals(qobj1, GLU_FLAT);
    glRotatef(80.0f, 1.0f, 0.0f, 0.0f);
    gluCylinder(qobj1, 2, 2, 15.0, 20, 5);

  glPushMatrix();
  glTranslatef(0, 0, 15);
    glutSolidSphere(3, 15, 15);

}

void Odysseus::LegLower(bool stone)
{
  if(stone)
    glColor3ub(200, 200, 200);
  else
    glColor3ub(176, 93, 30);
//------------- lower
  glPushMatrix();
    glTranslatef(0, 0, 2);
    gluQuadricDrawStyle(qobj1, GLU_FILL); /* flat shaded */
    gluQuadricNormals(qobj1, GLU_FLAT);
    gluCylinder(qobj1, 2, 2, 10.0, 20, 5);

  glPushMatrix();
    glTranslatef(0, 2, 10);
    glScalef(1, 2, 1);
    glutSolidSphere(3, 15, 15);
  glPopMatrix();
  glPopMatrix();
  glPopMatrix();
  glPopMatrix();
}

void Odysseus::RotateLocalY(GLfloat angle)
{
  Yaw += angle;

  if(Yaw > 360.0f)
    Yaw -= 360.0f;
  else if(Yaw < 0.0f)
    Yaw += 360.0f;
}

void Odysseus::FowardMove(GLfloat unit)
{
  X += sin(ToRad(Yaw)) * unit;
  Z += cos(ToRad(Yaw)) * unit;

  if(unit > 0)
  {
    //-------------------------------------
    //If LegBendFOrward is true then the right leg is "false"
    if(legSwing >= 20)
    {
      LegBendForward = true;
    }
    else if(legBend >= 60)
    {
      LegBendForward = false;  
    }

    if(legSwing >= 30)
    {
      LegForward = false;
    }
    else if(legSwing <= -30)
    {
      LegForward = true;
    }

  }
  else if(unit < 0)
  {
    if(legSwing >= 20)
    {
      LegBendForward = false;
    }
    else if(legBend >= 60)
    {
      LegBendForward = true;
    }

    if(legSwing >= 30)
    {
      LegForward = true;
    }
    else if(legSwing <= -30)
    {
      LegForward = false;
    }
  }

  //------------------- Left Leg move
  switch(LegForward)
  {
    case true:
      legSwing += unit * 5;
      RLegSwing -= unit * 5;
      break;
    case false:
      legSwing -= unit * 5;
      RLegSwing += unit * 5;
      break;
  }
  switch(LegBendForward)
  {
    case true: 
      legBend += unit * 4;
      RLegBend -= unit * 4;
      break;
    case false:
      legBend -= unit * 4;
      RLegBend += unit * 4;
      break;
  }
  
  if(sqrt(pow(X, 2) + pow(Z,2)) < 50)
  {
    X -= sin(ToRad(Yaw)) * unit;
    Z -= cos(ToRad(Yaw)) * unit;
  }
}

void Odysseus::GetMyPos(GLfloat &rX, GLfloat &rY, GLfloat &rZ)
{
  rX = X;
  rY = size;
  rZ = Z;
}


 

]]>