• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Poigahn

A Rubic's Cube Type Problem !

10 posts in this topic

Let me start by saying I searched the Vintage post for This topic, and did not find anything Useful.

 

1 - Has anyone solved the rotations of the Rubic's Cube, other than "Peeling of the color squares and re-applaying them" ?

    Doing That has me wondering, since I can not find in any of my books on 3D graphics. 

    How do I applay a texture to ONLY 1 Side of a Cube ?

2 - I can Apply 6 different colors to the cube ( 1 on each side via a UVMapper software and then creating a Skin Texture )

     But since I want to apply an Image to this Cube, when the Cube is rotated, Peices of the Image are also Rotated, rendering them Upside down.

    I want the images to remain upright so how do I Manipulate the image only on 1 side of the cube ?

 

I hope I worded this correctly .  Basically, I want to know how to take 6 different images and apply each image to the appropriate side of my Cube?

0

Share this post


Link to post
Share on other sites
Why not render 3 * 3 * 3 Cubes with solid colors? and rotating them ? Wouldnt it be easier?


Also there are a hell of algoritms to sucessfully solve the rubik cube, searching google throws a hell of results. Edited by Morphex
1

Share this post


Link to post
Share on other sites

I believe his actual query is not about algorithms to solve the Rubic's cube, but how to keep the colours of the mini-squares on the surface intact while rotations.

I think, peeling and re-applying is the best option from rendering complexity perspective.

Basically, it's easier to shade subsequent colour changes for the mini quares on each cube solving step, for very obvious reasons.

1

Share this post


Link to post
Share on other sites

I am Not Trying to Solve Rubic's Cube -  The Problem I am trying to solve involves the graphics. The solution I have is a 6 x 3 x 3 ( 6 sides x 3 rows x 3 coloumns) each cube can only be attached to a single pivot point , so you can only rotate on only 1 of the X - Y - Z axis.  This I can control, and effectively display and rotate a Rubic's Type Cube.

  What a want my Cube to do is display a 6 Photo graphs ( 1 on each side of the Cube, sub-divided into the 3 x 3 cubes, Spin it like a Rubics Cube, and Keep the divided photo Up right on the spin, so that when the entire cube is turned to view the backside the individual photo pieces are all up-right.

  Right now any "Twist" Renders the peices upside on the backside of the Cube.

  I need to effectively, only remove or spin the upside images on only 1 side of a 6 sided sub cube.  It may help to visualize this by taking an Actual Rubics Cube, attach Numbers to the individual cubes and spin it vertically once and the look at the backside of the rubics cube to see what I mean.

0

Share this post


Link to post
Share on other sites
Also there are a hell of algoritms to sucessfully solve the rubik cube, searching google throws a hell of results.

Indeed. Searching "rubik's cube" gives 7.89 megagoogles.

1

Share this post


Link to post
Share on other sites
Why not render 3 * 3 * 3 Cubes with solid colors? and rotating them ? Wouldnt it be easier?

 

Well, that would be 3 * 3 * 3 - 1 cubes, since the center one doesn't exist smile.png but I think that approach makes more sense than trying to paint entire faces in one shot.

0

Share this post


Link to post
Share on other sites
Number all of the faces of an actual Rubik's Cube, like you suggested. Look at a single side. Let's say you are looking down the z axis. If you rotate the three slices perpendicular to the y (up) axis, the numbers on the face you were looking at will maintain their orientation. However, if you rotate the three slices perpendicular to the x (side) axis, you'll find that the number's orientations will, in fact, flip. Even when you rotate the slices perpendicular to the y axis, the orientation of the numbers on the faces at the top and bottom of the cube, relative to your view position, will change.

This is correct. Why do you expect a different result? Edited by MarkS
0

Share this post


Link to post
Share on other sites

Either I am Not Explaining what I am Trying to do correctly or most of you are not understanding (Except NewDisplyName)

1 - I am NOT having a problem with Displaying a 3x3 cube Grid,  No Problem Rotating it. 

2 - I understand than when rows or columns are rotating that certain positions will be upside down or sideways ( This not a Problem with solid colors )

 

  I am currently Using 26 different skins, ( Generated Internally ) to display 6 different Pictures, Sub-divided by the 9 cubes on each side.

 I am not having a problem when the cube is twisted of keeping track on what Part a any picture is at any time.

My problem is a Pshycological Visualization of the Picture Puzzle when the Picture is upside down. ( players cannot visualize where that piece would go )

 

My problem is how would I twist the "1" side that is not upright, without twisting the whole sub-cube.and Re-skinning. ( Twisting the whole sub-cube throws the picture Pieces off track.

 

Maybe this just can't be done.

0

Share this post


Link to post
Share on other sites

I think I get what you mean,you want to "roatate" the face of the cube to always display the picture in the correct direction correct? The way I am seeing is changing the UV coordinates that you have attribute to Flip the texture i the correct direction, so if you flip the cube it will ways face the correct direction is this what you want?

 

Otherwise I am not getting what you mean.

0

Share this post


Link to post
Share on other sites

That is correct Morphex.  I don't know how to lift the image off a Texture Skin from a UV-Map or how to access the Co-Ordinates.  It may be simple once I know how, But since I am Just getting into 3D Graphics I am Lost at this point.

  Essentially I just Need to Re-Orintate 1 of 6 images to display it upright.  Can you help ?

0

Share this post


Link to post
Share on other sites
This is how I did it: logically, the cube consists of six faces, each with nine pieces. Each face has a base orientation such that if you have a solved cube and the cube is rotated by that base orientation, you are looking at that face with the texture oriented right side up. From this view, you have four adjacent faces, each of which are called the North, East, South or West neighbor. To minimize special cases, I chose the orientations in such a way that every face is it's northern neighbor's eastern neighbor. This created a (non-unique) face adjacency table of:
  const int face_adjacency[6][4] = {
    { 1, 2, 4, 3 },
    { 2, 0, 3, 5 },
    { 0, 1, 5, 4 },
    { 4, 5, 1, 0 },
    { 5, 3, 0, 2 },
    { 3, 4, 2, 1 }
  };

Every piece has three pieces of information: which face it's texture was originally on, which part of the texture it is (upper left, upper center, upper right, etc.) and what the current orientation is. Originally each piece has an orientation I called North. Now if you take this face and rotate it right (clockwise) ninety degrees, then the upper right piece will now have the texture the upper left piece had, but it's orientation is now East rather than North. Similarly, the upper center piece now has the texture of the middle right piece, but is also oriented East rather than North, and the center just changes orientation. Basically there are two cycles of pieces that need to be swapped: UR, UL, LL, LR and UC, MR, LC, ML. With an assigned enum values of North = 0, East = 1, South = 2 and West = 3, it means that each of these right rotations needs to increment facing by 1 (mod 4).

However, rotation also requires swapping the piece information for the adjacent pieces on the adjacent faces. There are three cycles to be considered here: N.UR, E.UL, S.LR, W.LL; N.MR, E.UC, S.LC, W.ML and N.LR, E.UR, S.LL, and W.UL. (Where N.UR is the adjacent face on the north's upper right piece, etc.) Like the previous rotations, these also require a facing change, though it's not quite as simple as adding one. Moving from the west face to the north face adds 2, from the south face to the west face adds 1, from the east face to the south face adds 2 and from the north face to the east face adds 3 (all mod 4).

From here rendering each piece is a matter of taking the texture coordinates associated the piece's texture part (upper left, upper center, etc.) and offsetting them according the the orientation. If the piece's orientation is north, then the first texture coordinate should go with the first vertex, second texture coordinate with the second vertex, and so on. If the piece's orientation is east, then the first vertex should go with the second texture coordinate, and so on. Basically add the orientation value and take the modulus by four. (It might be subtract the orientation value depending if you're using clockwise or counter-clockwise winding.)
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0