GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • DirectionalLight
      • Game
      • GameElement
      • GameEventHandler
      • IGameBehavior
      • Input
      • Input.Keys
      • Layer
      • Light
      • Light2D
      • PointLight
      • Scene
      • Scene2D
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
      • Window
      • Window.WindowEventHandler
      • WindowUtilities
      • WindowUtilities.POINT
      • WindowUtilities.RECT
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger
      • CapsuleCollider
      • CapsuleRigidBody
      • CompoundMeshCollider
      • ConvexHullBehavior
      • ConvexHullCollider
      • MeshCollider
      • QubeConvexHull
      • SphereCollider
      • SphereRigidBody
      • SphereTrigger
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • FindPathAsynchResult
      • GridCell
      • Model
      • NavMesh
      • Obstacle
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sphere
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
      • Waypoint
    • Genesis.Graphics
      • Animation
      • AnimationCallback
      • AnimationCallback.AnimationEvent
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Frustum
      • Glyphe
      • IRenderDevice
      • InstancedElement
      • InstancedMesh
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • RenderInstanceContainer
      • RenderSettings
      • Shader
      • ShaderProgram
      • SpriteSheet
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • GLRenderer
      • LegacyRenerer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • BorderCircleShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • Element3DShader
      • FXScreenSpaceShadowShader
      • InstanceShader2D
      • InstancedShader
      • Light2DShader
      • LightmapShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SolidShapeShader
      • SpecularShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • CircleShape
      • FrameShape
      • GlypheShape
      • Light2DShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SphereShape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • ColliderBehavior2D
      • ColliderBehavior3D
      • CollisionGroup
      • CollisionGroupExtensions
      • HitResult
      • HitResult2D
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Ray2D
      • Raycast
      • Raycast2D
      • RigidBodyBehavior2D
      • RigidBodyBehavior3D
      • TriggerBehavior2D
      • TriggerBehavior3D
    • Genesis.UI
      • Button
      • Canvas
      • GridView
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget
      • WidgetAnchor
    • Genesis.UI.Items
      • GridViewImageIcon
      • IItem

    Class SphereShape

    Represents a 3D sphere shape with configurable latitude, longitude, and radius. Provides methods to retrieve vertex positions, normals, texture coordinates, and colors.

    Inheritance
    object
    Shape
    SphereShape
    Inherited Members
    Shape.vbo
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Genesis.Graphics.Shapes
    Assembly: Genesis.dll
    Syntax
    public class SphereShape : Shape

    Constructors

    SphereShape()

    Declaration
    public SphereShape()

    Properties

    LatitudeBands

    Gets or sets the number of horizontal segments of the sphere.

    Declaration
    public int LatitudeBands { get; set; }
    Property Value
    Type Description
    int

    LongitudeBands

    Gets or sets the number of vertical segments of the sphere.

    Declaration
    public int LongitudeBands { get; set; }
    Property Value
    Type Description
    int

    Radius

    Gets or sets the radius of the sphere.

    Declaration
    public float Radius { get; set; }
    Property Value
    Type Description
    float

    Methods

    GetColors(Color)

    Generates an array of color values for each vertex based on the specified color.

    Declaration
    public float[] GetColors(Color color)
    Parameters
    Type Name Description
    Color color

    The color to apply to each vertex.

    Returns
    Type Description
    float[]

    A float array containing RGB color values for each vertex.

    GetColors(Color, int, int)

    Generates an array of RGB color values for each vertex of the sphere.

    Declaration
    public static float[] GetColors(Color color, int latitudeBands, int longitudeBands)
    Parameters
    Type Name Description
    Color color

    The color to apply to each vertex.

    int latitudeBands

    The number of horizontal segments.

    int longitudeBands

    The number of vertical segments.

    Returns
    Type Description
    float[]

    A float array containing RGB color values for each vertex.

    GetIndices(int, int)

    Generates the indices required to construct triangles for the sphere's surface.

    Declaration
    public static int[] GetIndices(int latitudeBands, int longitudeBands)
    Parameters
    Type Name Description
    int latitudeBands

    The number of horizontal segments.

    int longitudeBands

    The number of vertical segments.

    Returns
    Type Description
    int[]

    An array of integers representing the indices of the sphere's vertices.

    GetNormals(int, int)

    Generates the normal vectors for each vertex of the sphere.

    Declaration
    public static float[] GetNormals(int latitudebands, int longitudebands)
    Parameters
    Type Name Description
    int latitudebands

    The number of horizontal segments.

    int longitudebands

    The number of vertical segments.

    Returns
    Type Description
    float[]

    A float array containing the normals for each vertex.

    GetOrderedColors(Color)

    Retrieves the ordered color values for the sphere's vertices based on the specified color.

    Declaration
    public float[] GetOrderedColors(Color color)
    Parameters
    Type Name Description
    Color color

    The color to apply to each vertex.

    Returns
    Type Description
    float[]

    A float array containing ordered RGB color values for each vertex.

    GetOrderedNormals()

    Retrieves the ordered normals for the sphere's vertices.

    Declaration
    public float[] GetOrderedNormals()
    Returns
    Type Description
    float[]

    A float array containing the normals ordered by vertex indices.

    GetOrderedTextureCoordinates()

    Retrieves the ordered texture coordinates for the sphere's vertices.

    Declaration
    public float[] GetOrderedTextureCoordinates()
    Returns
    Type Description
    float[]

    A float array containing the texture coordinates ordered by vertex indices.

    GetShape()

    Constructs the geometry of the sphere by combining vertex positions and indices.

    Declaration
    public override float[] GetShape()
    Returns
    Type Description
    float[]

    A float array containing the ordered vertex positions of the sphere.

    Overrides
    Shape.GetShape()

    GetTextureCoordinates(int, int)

    Generates the texture coordinates for each vertex of the sphere.

    Declaration
    public static float[] GetTextureCoordinates(int latitudebands, int longitudebands)
    Parameters
    Type Name Description
    int latitudebands

    The number of horizontal segments.

    int longitudebands

    The number of vertical segments.

    Returns
    Type Description
    float[]

    A float array containing the texture coordinates for each vertex.

    GetVertices(int, int, float)

    Generates the vertices for the sphere based on latitude and longitude segments and the radius.

    Declaration
    public static float[] GetVertices(int latitudebands, int longitudebands, float radius)
    Parameters
    Type Name Description
    int latitudebands

    The number of horizontal segments.

    int longitudebands

    The number of vertical segments.

    float radius

    The radius of the sphere.

    Returns
    Type Description
    float[]

    A float array containing the vertex positions for the sphere.

    In this article
    Back to top Generated by DocFX