This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-11-21 18:49:28

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

One Sprite One Script 3D Wireframe Renderer

http://scratch.mit.edu/projects/RHY3756547/769041

This is a One-Sprite One-Script 3D renderer that read from 3 Lists and draws from point to point with a Changable FOV, changable cube position offset and changable Camera Position. Also, you can rotate the model in Pitch, Yaw and Roll. Personally I think the data format could be better but it works OK if you know what you're doing.

Controls: Use the Arrow Keys to rotate the cube on the X and Y axis. Use the Sliders to move the camera, Cube Center Position and Z rotation. Also, if you don't like the current colour you can change it with the sider down at the bottom left.  smile

Tell me what you think, any glitches and suggestions.

Future Features: Camera Rotation, Back Culling.

Variables:

Center X, Y and Z: These variables offset the cube from it's center point which the cube rotates around.

Xpos, Ypos and Zpos: These variables define the Cube's position in the 3D world. This does not affect rotation.

Camera X, Y and Z: These variables move where the camera is in the 3D world. This does not affect the true positions of the 3D models.

FOV: This Variable controls the Field of View, which is basically how contrasting Z positions are.

X (hidden), Y (hidden), and Zrot: These variables control the rotation of the cube.

Pen Colour: This variable changes the colour that the cube is rendered in.

---Hidden:---

Light Contrast: This variable controls how far a light goes before befoming dark.

Light Strength: This Variable controls how strong a light is.

LightingMin/MaxStrength: These variables control how dark or light an object can be before sticking to a fixed value.

MainLight X, Y and Zpos: These variables control the position of the main scene light.

CameraZoom: This variable controls the zoom on the camera. This does NOT have anything to do with the Z axis.

Last edited by RHY3756547 (2009-11-21 18:50:11)

Offline

 

#2 2009-11-21 18:50:40

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: One Sprite One Script 3D Wireframe Renderer

S65 made a real time wire-frame cube renderer.


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

#3 2009-11-22 04:20:49

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: One Sprite One Script 3D Wireframe Renderer

demosthenes wrote:

S65 made a real time wire-frame cube renderer.

He did that by duplicating the scripts to create atomicity. I'm not going to do this because it breaks compatibility with more complex models. To make it realtime you should use BYOB (put the render commands in a block).

Offline

 

#4 2009-11-22 10:41:34

MarkWhoIsCool
Scratcher
Registered: 2009-07-27
Posts: 61

Re: One Sprite One Script 3D Wireframe Renderer

That is so awesome.  big_smile

Offline

 

#5 2009-11-22 10:56:12

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: One Sprite One Script 3D Wireframe Renderer

RHY3756547 wrote:

demosthenes wrote:

S65 made a real time wire-frame cube renderer.

He did that by duplicating the scripts to create atomicity. I'm not going to do this because it breaks compatibility with more complex models. To make it realtime you should use BYOB (put the render commands in a block).

But then if you use BYOB you can't upload here. But that is the perfect way to make 1 script 1 sprite projects! Just make it all into one block!


Scratchin' since 2007

Offline

 

#6 2009-11-22 12:04:18

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: One Sprite One Script 3D Wireframe Renderer

I released a .obj reader here:
http://scratch.mit.edu/projects/RHY3756547/770414

In the future this will be used to convert models into usable formats for my renderer. This will also work with Backface Culling.  smile

Offline

 

#7 2009-11-25 13:03:56

RHY3756547
Scratcher
Registered: 2009-08-15
Posts: 1000+

Re: One Sprite One Script 3D Wireframe Renderer

I improved the renderer a LOT. It now works 4x faster! Clipping is also corrected.

Offline

 

Board footer